Changeset: 5922e91aa1b7 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/5922e91aa1b7 Modified Files: cmake/monetdb-defines.cmake gdk/gdk_posix.c gdk/gdk_posix.h Branch: Aug2024 Log Message:
Backed out changeset 336b3853b610: it doesn't work correctly. Back to the drawing board. diffs (46 lines): diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -84,7 +84,6 @@ function(monetdb_configure_defines) check_function_exists("getuid" HAVE_GETUID) check_symbol_exists("gmtime_r" "time.h" HAVE_GMTIME_R) check_symbol_exists("localtime_r" "time.h" HAVE_LOCALTIME_R) - check_symbol_exists("strerror_s" "string.h" HAVE_STRERROR_S) check_symbol_exists("strerror_r" "string.h" HAVE_STRERROR_R) check_function_exists("lockf" HAVE_LOCKF) check_symbol_exists("madvise" "sys/mman.h" HAVE_MADVISE) diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c --- a/gdk/gdk_posix.c +++ b/gdk/gdk_posix.c @@ -1013,7 +1013,7 @@ ctime_r(const time_t *restrict t, char * } #endif -#if !defined(HAVE_STRERROR_R) && !defined(HAVE_STRERROR_S) +#ifndef HAVE_STRERROR_R static MT_Lock strerrlock = MT_LOCK_INITIALIZER(strerrlock); int diff --git a/gdk/gdk_posix.h b/gdk/gdk_posix.h --- a/gdk/gdk_posix.h +++ b/gdk/gdk_posix.h @@ -182,15 +182,14 @@ gdk_export int strerror_r(int errnum, ch static inline const char * GDKstrerror(int errnum, char *buf, size_t buflen) { -#ifdef HAVE_STRERROR_S - if (strerror_s(buf, buflen, errnum) == 0) - return buf; -#else +#if !defined(_GNU_SOURCE) || ((_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE) if (strerror_r(errnum, buf, buflen) == 0) return buf; -#endif snprintf(buf, buflen, "Unknown error %d", errnum); return buf; +#else + return strerror_r(errnum, buf, buflen); +#endif } #endif /* GDK_POSIX_H */ _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org