-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it compile on Musl and fix warnings #35
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 macro
Basically this code for
XXXXX
= {PRI64d
,PRIszu
,PRI64u
,PRI64x
,PRIpdd
}:Include
fcntl.h
instead ofsys/fcntl.h
fcntl.h
was already used inleveldb/util/env_posix.cc
andleveldb/db/corruption_test.cc
andsys/fcntl.h
throws 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
%u
forCTransaction.nTime
,%PRI64d
forGetBlockTime()
.Fix misleading indentation
Use
unique_ptr
instead ofauto_ptr
auto_ptr
is deprecated.Add default
return
inexp_n2
Doesn't change the return value but fixes the following warning:
x
andw
inGaussianQuad_N
Fix the following warning:
util.cpp
Fix the following warning:
nPos
inGetClientVersion
Fix the following warning: