diff --git a/ChangeLog b/ChangeLog index b46bb75c8..e647b12bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2021-02-12 Frederik Seiffert + + * Headers/Foundation/NSNull.h: Add missing GS_EXPORT_CLASS. + * Tests/base/Functions/NSByteSwapping.m: Define M_PI if needed. + * configure: + * configure.ac: Add support for pthreadVC2 library variant and + tweak host OS check for Windows to be more specific. + 2021-02-05 Fred Kiefer * Tools/make_strings/StringsFile.m: Write the file in UTF8 format diff --git a/Headers/Foundation/NSNull.h b/Headers/Foundation/NSNull.h index b584d71c9..63d072861 100644 --- a/Headers/Foundation/NSNull.h +++ b/Headers/Foundation/NSNull.h @@ -37,6 +37,7 @@ extern "C" { /* * An object to use as a placeholder - in collections for instance. */ +GS_EXPORT_CLASS @interface NSNull : NSObject + (NSNull*) null; @end diff --git a/Tests/base/Functions/NSByteSwapping.m b/Tests/base/Functions/NSByteSwapping.m index c2759af77..6f61f3e07 100644 --- a/Tests/base/Functions/NSByteSwapping.m +++ b/Tests/base/Functions/NSByteSwapping.m @@ -1,6 +1,10 @@ #import #import "Testing.h" +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950288 +#endif + int main() { NSAutoreleasePool *pool = [NSAutoreleasePool new]; diff --git a/configure b/configure index ec693bc87..e04def347 100755 --- a/configure +++ b/configure @@ -6119,7 +6119,7 @@ if test "$gs_cv_objc_libdir" != "NONE"; then # add to path on Windows for config checks to find DLL at runtime case $host_os in - mingw*|windows*) PATH=$PATH:$gs_cv_objc_libdir;; + mingw*|windows) PATH=$PATH:$gs_cv_objc_libdir;; esac fi @@ -7512,6 +7512,7 @@ ismingw=no checkinlibc=no case "$target_os" in mingw*) ismingw=yes;; + windows) iswindows=yes;; nto*) checkinlibc=yes;; qnx*) checkinlibc=yes;; *android*) checkinlibc=yes;; @@ -7566,6 +7567,53 @@ fi LIBS="$LIBS -lpthreadGC2" fi fi + if test $iswindows = yes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lpthreadVC2" >&5 +$as_echo_n "checking for pthread_join in -lpthreadVC2... " >&6; } +if ${ac_cv_lib_pthreadVC2_pthread_join+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthreadVC2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (); +int +main () +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthreadVC2_pthread_join=yes +else + ac_cv_lib_pthreadVC2_pthread_join=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreadVC2_pthread_join" >&5 +$as_echo "$ac_cv_lib_pthreadVC2_pthread_join" >&6; } +if test "x$ac_cv_lib_pthreadVC2_pthread_join" = xyes; then : + pthread_ok=yes +else + pthread_ok=no +fi + + if test $pthread_ok = yes ; then + LIBS="$LIBS -lpthreadVC2" + fi + fi # Android and QNX have pthread in libc instead of libpthread if test $checkinlibc = yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lc" >&5 diff --git a/configure.ac b/configure.ac index 834441ca7..aebf20ede 100644 --- a/configure.ac +++ b/configure.ac @@ -1349,7 +1349,7 @@ if test "$gs_cv_objc_libdir" != "NONE"; then # add to path on Windows for config checks to find DLL at runtime case $host_os in - mingw*|windows*) PATH=$PATH:$gs_cv_objc_libdir;; + mingw*|windows) PATH=$PATH:$gs_cv_objc_libdir;; esac fi @@ -1757,6 +1757,7 @@ ismingw=no checkinlibc=no case "$target_os" in mingw*) ismingw=yes;; + windows) iswindows=yes;; nto*) checkinlibc=yes;; qnx*) checkinlibc=yes;; *android*) checkinlibc=yes;; @@ -1770,6 +1771,12 @@ else LIBS="$LIBS -lpthreadGC2" fi fi + if test $iswindows = yes ; then + AC_CHECK_LIB(pthreadVC2, pthread_join, pthread_ok=yes, pthread_ok=no) + if test $pthread_ok = yes ; then + LIBS="$LIBS -lpthreadVC2" + fi + fi # Android and QNX have pthread in libc instead of libpthread if test $checkinlibc = yes ; then AC_CHECK_LIB(c, pthread_join, pthread_ok=yes, pthread_ok=no)