mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +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
95e4ed9e35
commit
c518b0f246
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. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* The normal alignment of `pthread_cond_t', in bytes. */
|
||||
#undef ALIGNOF_PTHREAD_COND_T
|
||||
|
||||
|
@ -469,6 +466,9 @@
|
|||
/* Define to 1 if you have the `sigsetjmp' function. */
|
||||
#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'. */
|
||||
#undef HAVE_SOCKLEN_T
|
||||
|
||||
|
@ -729,44 +729,26 @@
|
|||
/* Define if using the libffi library for invocations */
|
||||
#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 */
|
||||
#undef VASPRINTF_RETURNS_LENGTH
|
||||
|
||||
/* Define if vsprintf returns the length printed */
|
||||
#undef VSPRINTF_RETURNS_LENGTH
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
/* Define to 1 if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#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
|
||||
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
/* 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. */
|
||||
#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
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
|
|
|
@ -15,10 +15,10 @@ int main()
|
|||
NSString *path, *exepath;
|
||||
|
||||
|
||||
gnustepBundle = [NSBundle bundleForLibrary: @"gnustep-base"];
|
||||
|
||||
TEST_FOR_CLASS(@"NSBundle",gnustepBundle,
|
||||
"+bundleForLibrary: makes a bundle for us");
|
||||
PASS((
|
||||
[(gnustepBundle = [NSBundle bundleForLibrary: @"gnustep-base"])
|
||||
isKindOfClass: [NSBundle class]]),
|
||||
"+bundleForLibrary: makes a bundle for us")
|
||||
|
||||
PASS([gnustepBundle principalClass] == [NSObject class],
|
||||
"-principalClass returns NSObject for the +bundleForLibrary:gnustep-base");
|
||||
|
@ -35,9 +35,9 @@ int main()
|
|||
PASS(classBundle == [NSBundle mainBundle],
|
||||
"-mainBundle is the same as +bundleForClass:[TestClass class]");
|
||||
|
||||
PASS([[gnustepBundle classNamed:@"NSArray"] isEqual:[NSArray class]] &&
|
||||
[[NSArray class] isEqual: [gnustepBundle classNamed:@"NSArray"]],
|
||||
"-classNamed returns the correct class");
|
||||
PASS([[gnustepBundle classNamed: @"NSArray"] isEqual: [NSArray class]]
|
||||
&& [[NSArray class] isEqual: [gnustepBundle classNamed: @"NSArray"]],
|
||||
"-classNamed returns the correct class");
|
||||
|
||||
TEST_STRING([gnustepBundle resourcePath],"-resourcePath returns a string");
|
||||
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
#include "objc-common.g"
|
||||
#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_exited = 0;
|
||||
static unsigned class_entered = 0;
|
||||
|
@ -16,7 +23,7 @@ static BOOL may_proceed = NO;
|
|||
{
|
||||
initialize_entered++;
|
||||
while (NO == may_proceed)
|
||||
sleep(1);
|
||||
mySleep(1);
|
||||
initialize_exited++;
|
||||
}
|
||||
+ (Class) class
|
||||
|
@ -43,7 +50,7 @@ main()
|
|||
|
||||
while (0 == initialize_entered && counter++ < 3)
|
||||
{
|
||||
sleep(1);
|
||||
mySleep(1);
|
||||
}
|
||||
if (0 == initialize_entered)
|
||||
{
|
||||
|
@ -52,14 +59,14 @@ main()
|
|||
}
|
||||
if (0 == pthread_create(&t1, 0, test, 0))
|
||||
{
|
||||
sleep(1);
|
||||
mySleep(1);
|
||||
if (class_entered > 0)
|
||||
{
|
||||
fprintf(stderr, "class entered prematurely\n");
|
||||
return 1;
|
||||
}
|
||||
may_proceed = YES;
|
||||
sleep(1);
|
||||
mySleep(1);
|
||||
if (2 == class_entered)
|
||||
{
|
||||
return 0; // OK
|
||||
|
|
10
configure.ac
10
configure.ac
|
@ -1517,6 +1517,11 @@ fi
|
|||
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
|
||||
#--------------------------------------------------------------------
|
||||
|
@ -2036,11 +2041,6 @@ if test $ac_cv_func_inet_ntop = yes ; then
|
|||
fi
|
||||
AC_SUBST(HAVE_INET_NTOP)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# One of these function needed by NSThread.m
|
||||
#--------------------------------------------------------------------
|
||||
AC_CHECK_FUNCS(nanosleep usleep)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# For setting thread stack size
|
||||
#--------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue