Windows MSVC fixes

This commit is contained in:
Frederik Seiffert 2021-02-08 22:19:41 +01:00 committed by Frederik Seiffert
parent 19c32ba0f5
commit 5c562c546f
5 changed files with 70 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2021-02-12 Frederik Seiffert <frederik@algoriddim.com>
* 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 <fredkiefer@gmx.de>
* Tools/make_strings/StringsFile.m: Write the file in UTF8 format

View file

@ -37,6 +37,7 @@ extern "C" {
/*
* An object to use as a placeholder - in collections for instance.
*/
GS_EXPORT_CLASS
@interface NSNull : NSObject <NSCoding, NSCopying>
+ (NSNull*) null;
@end

View file

@ -1,6 +1,10 @@
#import <Foundation/Foundation.h>
#import "Testing.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288
#endif
int main()
{
NSAutoreleasePool *pool = [NSAutoreleasePool new];

50
configure vendored
View file

@ -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

View file

@ -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)