mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
tweak for mswindows
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32458 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
03233198f7
commit
83052c50ee
5 changed files with 5862 additions and 6375 deletions
|
@ -1,8 +1,5 @@
|
||||||
/* Headers/Additions/GNUstepBase/config.h.in. Generated from configure.ac by autoheader. */
|
/* Headers/Additions/GNUstepBase/config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
/* Define if building universal (internal helper macro) */
|
|
||||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
|
||||||
|
|
||||||
/* The normal alignment of `pthread_cond_t', in bytes. */
|
/* The normal alignment of `pthread_cond_t', in bytes. */
|
||||||
#undef ALIGNOF_PTHREAD_COND_T
|
#undef ALIGNOF_PTHREAD_COND_T
|
||||||
|
|
||||||
|
@ -469,6 +466,9 @@
|
||||||
/* Define to 1 if you have the `sigsetjmp' function. */
|
/* Define to 1 if you have the `sigsetjmp' function. */
|
||||||
#undef HAVE_SIGSETJMP
|
#undef HAVE_SIGSETJMP
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `sleep' function. */
|
||||||
|
#undef HAVE_SLEEP
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `socklen_t'. */
|
/* Define to 1 if the system has the type `socklen_t'. */
|
||||||
#undef HAVE_SOCKLEN_T
|
#undef HAVE_SOCKLEN_T
|
||||||
|
|
||||||
|
@ -729,44 +729,26 @@
|
||||||
/* Define if using the libffi library for invocations */
|
/* Define if using the libffi library for invocations */
|
||||||
#undef USE_LIBFFI
|
#undef USE_LIBFFI
|
||||||
|
|
||||||
/* Enable extensions on AIX 3, Interix. */
|
|
||||||
#ifndef _ALL_SOURCE
|
|
||||||
# undef _ALL_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable GNU extensions on systems that have them. */
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
# undef _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable threading extensions on Solaris. */
|
|
||||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
|
||||||
# undef _POSIX_PTHREAD_SEMANTICS
|
|
||||||
#endif
|
|
||||||
/* Enable extensions on HP NonStop. */
|
|
||||||
#ifndef _TANDEM_SOURCE
|
|
||||||
# undef _TANDEM_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable general extensions on Solaris. */
|
|
||||||
#ifndef __EXTENSIONS__
|
|
||||||
# undef __EXTENSIONS__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Define if vasprintf returns the length printed */
|
/* Define if vasprintf returns the length printed */
|
||||||
#undef VASPRINTF_RETURNS_LENGTH
|
#undef VASPRINTF_RETURNS_LENGTH
|
||||||
|
|
||||||
/* Define if vsprintf returns the length printed */
|
/* Define if vsprintf returns the length printed */
|
||||||
#undef VSPRINTF_RETURNS_LENGTH
|
#undef VSPRINTF_RETURNS_LENGTH
|
||||||
|
|
||||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
/* Define to 1 if your processor stores words with the most significant byte
|
||||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
|
||||||
# if defined __BIG_ENDIAN__
|
|
||||||
# define WORDS_BIGENDIAN 1
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# ifndef WORDS_BIGENDIAN
|
|
||||||
#undef WORDS_BIGENDIAN
|
#undef WORDS_BIGENDIAN
|
||||||
|
|
||||||
|
/* Define to 1 if on AIX 3.
|
||||||
|
System headers sometimes define this.
|
||||||
|
We just want to avoid a redefinition error message. */
|
||||||
|
#ifndef _ALL_SOURCE
|
||||||
|
# undef _ALL_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Enable GNU extensions on systems that have them. */
|
||||||
|
#ifndef _GNU_SOURCE
|
||||||
|
# undef _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if on MINIX. */
|
/* Define to 1 if on MINIX. */
|
||||||
|
@ -779,6 +761,17 @@
|
||||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||||
#undef _POSIX_SOURCE
|
#undef _POSIX_SOURCE
|
||||||
|
|
||||||
|
/* Enable extensions on Solaris. */
|
||||||
|
#ifndef __EXTENSIONS__
|
||||||
|
# undef __EXTENSIONS__
|
||||||
|
#endif
|
||||||
|
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||||
|
# undef _POSIX_PTHREAD_SEMANTICS
|
||||||
|
#endif
|
||||||
|
#ifndef _TANDEM_SOURCE
|
||||||
|
# undef _TANDEM_SOURCE
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
|
|
|
@ -15,10 +15,10 @@ int main()
|
||||||
NSString *path, *exepath;
|
NSString *path, *exepath;
|
||||||
|
|
||||||
|
|
||||||
gnustepBundle = [NSBundle bundleForLibrary: @"gnustep-base"];
|
PASS((
|
||||||
|
[(gnustepBundle = [NSBundle bundleForLibrary: @"gnustep-base"])
|
||||||
TEST_FOR_CLASS(@"NSBundle",gnustepBundle,
|
isKindOfClass: [NSBundle class]]),
|
||||||
"+bundleForLibrary: makes a bundle for us");
|
"+bundleForLibrary: makes a bundle for us")
|
||||||
|
|
||||||
PASS([gnustepBundle principalClass] == [NSObject class],
|
PASS([gnustepBundle principalClass] == [NSObject class],
|
||||||
"-principalClass returns NSObject for the +bundleForLibrary:gnustep-base");
|
"-principalClass returns NSObject for the +bundleForLibrary:gnustep-base");
|
||||||
|
@ -35,8 +35,8 @@ int main()
|
||||||
PASS(classBundle == [NSBundle mainBundle],
|
PASS(classBundle == [NSBundle mainBundle],
|
||||||
"-mainBundle is the same as +bundleForClass:[TestClass class]");
|
"-mainBundle is the same as +bundleForClass:[TestClass class]");
|
||||||
|
|
||||||
PASS([[gnustepBundle classNamed:@"NSArray"] isEqual:[NSArray class]] &&
|
PASS([[gnustepBundle classNamed: @"NSArray"] isEqual: [NSArray class]]
|
||||||
[[NSArray class] isEqual: [gnustepBundle classNamed:@"NSArray"]],
|
&& [[NSArray class] isEqual: [gnustepBundle classNamed: @"NSArray"]],
|
||||||
"-classNamed returns the correct class");
|
"-classNamed returns the correct class");
|
||||||
|
|
||||||
TEST_STRING([gnustepBundle resourcePath],"-resourcePath returns a string");
|
TEST_STRING([gnustepBundle resourcePath],"-resourcePath returns a string");
|
||||||
|
|
|
@ -4,6 +4,13 @@
|
||||||
#include "objc-common.g"
|
#include "objc-common.g"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#define mySleep(X) usleep(1000*(X))
|
||||||
|
#else
|
||||||
|
#define mySleep(X) sleep(X)
|
||||||
|
#endif
|
||||||
|
|
||||||
static unsigned initialize_entered = 0;
|
static unsigned initialize_entered = 0;
|
||||||
static unsigned initialize_exited = 0;
|
static unsigned initialize_exited = 0;
|
||||||
static unsigned class_entered = 0;
|
static unsigned class_entered = 0;
|
||||||
|
@ -16,7 +23,7 @@ static BOOL may_proceed = NO;
|
||||||
{
|
{
|
||||||
initialize_entered++;
|
initialize_entered++;
|
||||||
while (NO == may_proceed)
|
while (NO == may_proceed)
|
||||||
sleep(1);
|
mySleep(1);
|
||||||
initialize_exited++;
|
initialize_exited++;
|
||||||
}
|
}
|
||||||
+ (Class) class
|
+ (Class) class
|
||||||
|
@ -43,7 +50,7 @@ main()
|
||||||
|
|
||||||
while (0 == initialize_entered && counter++ < 3)
|
while (0 == initialize_entered && counter++ < 3)
|
||||||
{
|
{
|
||||||
sleep(1);
|
mySleep(1);
|
||||||
}
|
}
|
||||||
if (0 == initialize_entered)
|
if (0 == initialize_entered)
|
||||||
{
|
{
|
||||||
|
@ -52,14 +59,14 @@ main()
|
||||||
}
|
}
|
||||||
if (0 == pthread_create(&t1, 0, test, 0))
|
if (0 == pthread_create(&t1, 0, test, 0))
|
||||||
{
|
{
|
||||||
sleep(1);
|
mySleep(1);
|
||||||
if (class_entered > 0)
|
if (class_entered > 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "class entered prematurely\n");
|
fprintf(stderr, "class entered prematurely\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
may_proceed = YES;
|
may_proceed = YES;
|
||||||
sleep(1);
|
mySleep(1);
|
||||||
if (2 == class_entered)
|
if (2 == class_entered)
|
||||||
{
|
{
|
||||||
return 0; // OK
|
return 0; // OK
|
||||||
|
|
10
configure.ac
10
configure.ac
|
@ -1517,6 +1517,11 @@ fi
|
||||||
AC_CHECK_LIB(rt, sched_yield)
|
AC_CHECK_LIB(rt, sched_yield)
|
||||||
|
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# One of these function needed by NSThread.m and objc initialize test
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
AC_CHECK_FUNCS(nanosleep usleep Sleep)
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# Check whether Objective-C /really/ works
|
# Check whether Objective-C /really/ works
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
@ -2036,11 +2041,6 @@ if test $ac_cv_func_inet_ntop = yes ; then
|
||||||
fi
|
fi
|
||||||
AC_SUBST(HAVE_INET_NTOP)
|
AC_SUBST(HAVE_INET_NTOP)
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
|
||||||
# One of these function needed by NSThread.m
|
|
||||||
#--------------------------------------------------------------------
|
|
||||||
AC_CHECK_FUNCS(nanosleep usleep)
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# For setting thread stack size
|
# For setting thread stack size
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue