estraier / tkrzw

a set of implementations of DBM
Apache License 2.0
169 stars 21 forks source link

0.9.15 @ macOS build error #16

Closed tieugene closed 3 years ago

tieugene commented 3 years ago
clang++ -c -I. -I/usr/local/Cellar/tkrzw/0.9.15/include -DNDEBUG -D_GNU_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=999999L -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D__EXTENSIONS__ -D_TKRZW_PREFIX="\"/usr/local/Cellar/tkrzw/0.9.15\"" -D_TKRZW_INCLUDEDIR="\"/usr/local/Cellar/tkrzw/0.9.15/include\"" -D_TKRZW_LIBDIR="\"/usr/local/Cellar/tkrzw/0.9.15/lib\"" -D_TKRZW_BINDIR="\"/usr/local/Cellar/tkrzw/0.9.15/bin\"" -D_TKRZW_LIBEXECDIR="\"/usr/local/Cellar/tkrzw/0.9.15/libexec\"" -D_TKRZW_APPINC="\"-I/usr/local/Cellar/tkrzw/0.9.15/include\"" -D_TKRZW_APPLIBS="\"-L/usr/local/Cellar/tkrzw/0.9.15/lib -ltkrzw -lstdc++ -lpthread -lm -lc \"" -D_TKRZW_PKG_VERSION="\"0.9.15\"" -D_TKRZW_LIB_VERSION="\"1.5.0\"" -MMD -g -O2 -std=c++17 -pthread -fPIC -fsigned-char tkrzw_thread_util.cc
tkrzw_lib_common.cc:52:15: error: no member named 'aligned_alloc' in namespace 'std'; did you mean simply 'aligned_alloc'?
  void* ptr = std::aligned_alloc(alignment, size);
              ^~~~~~~~~~~~~~~~~~
              aligned_alloc
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/malloc/_malloc.h:50:10: note: 'aligned_alloc' declared here
void    *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_size(2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
         ^
1 error generated.
make: *** [tkrzw_lib_common.o] Error 1
estraier commented 3 years ago

I committed a change to use the fallback function for aligned_alloc on Mac.

tieugene commented 3 years ago

0.9.16 ok