Make it compile on Musl and fix warnings#35
Conversation
There was a problem hiding this comment.
great work!
this commit throwing error:
16c7511
tested @ debian 9 stretch x64
make -f makefile.unix
/bin/sh ../share/genbuild.sh obj/build.h
g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -I/mnt/gits/eqcore/src -I/mnt/gits/eqcore/src/hash -I/mnt/gits/eqcore/src/obj -DUSE_UPNP=0 -DUSE_IPV6=1 -I/mnt/gits/eqcore/src/leveldb/include -I/mnt/gits/eqcore/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2 -msse2 -MMD -MF obj/netbase.d -o obj/netbase.o netbase.cpp
In file included from netbase.cpp:15:0:
strlcpy.h:16:0: error: unterminated #ifndef
#ifndef BITCOIN_STRLCPY_H
makefile.unix:186: recipe for target 'obj/netbase.o' failed
make: *** [obj/netbase.o] Error 1
|
Did you apply this commit too: b0264b0? Should work. |
Make it compile on Musl
Not quite sure that
#if !defined(__linux__) || defined(__GLIBC__)(instrlcpy.h) is the best way to do it, but it works.Fix warnings:
C++11 requires a space between literal and string macroBasically this code for
XXXXX= {PRI64d,PRIszu,PRI64u,PRI64x,PRIpdd}:Include
fcntl.hinstead ofsys/fcntl.hfcntl.hwas already used inleveldb/util/env_posix.ccandleveldb/db/corruption_test.ccandsys/fcntl.hthrows a warning.Remove two unused variables
Those variables weren't used in the code or in some comments, so I removed them instead of commenting them out.
Fix wrong formats
%uforCTransaction.nTime,%PRI64dforGetBlockTime().Fix misleading indentation
Use
unique_ptrinstead ofauto_ptrauto_ptris deprecated.Add default
returninexp_n2Doesn't change the return value but fixes the following warning:
xandwinGaussianQuad_NFix the following warning:
util.cppFix the following warning:
nPosinGetClientVersionFix the following warning: