rescrv / po6

POSIX wrappers for C++
BSD 3-Clause "New" or "Revised" License
28 stars 15 forks source link

0.8 doesn't compile on *BSD (including OS X) #9

Open atombender opened 8 years ago

atombender commented 8 years ago

This is due to errno.cc attempting to use the GNU version of strerror_p, which is different on *BSD.

make: Entering directory `/private/tmp/libpo620160213-82219-14gc7tw/libpo6-0.8.0'
/Applications/Xcode.app/Contents/Developer/usr/bin/make --no-print-directory all-am
  CXX      errno.lo
errno.cc:51:5: error: no matching function for call to 'strncpy'
    strncpy(buf, strerror_r(err, buf, sizeof(buf)), sizeof(buf));
    ^~~~~~~
/usr/include/string.h:85:7: note: candidate function not viable: no known conversion from 'int' to 'const char *' for 2nd argument
char    *strncpy(char *, const char *, size_t);
         ^
1 error generated.

This means Hyperdex 1.8.1 doesn't compile, either, since it wants libpo6 >= 0.8. Can you roll another release with your latest fixes?

michelkaporin commented 6 years ago

It was solved as part of the latest code refactorings in https://github.com/rescrv/po6/blob/bfb73ea7a44a113e54fa717f6290b18997457071/errno.cc

If you have downloaded libpo6-0.8.0 from http://hyperdex.org/src to resolve the issue and were able to make it, just update lines 36-63 of errno.cc in extracted .tar.gz with lines 35-67 from the link above.