libobjc2: tweaks to build on Windows

This commit is contained in:
ericwa 2010-09-03 21:08:06 +00:00
parent fe566cbc2f
commit 7a2c302c5f
3 changed files with 18 additions and 2 deletions

View File

@ -52,7 +52,7 @@ ifeq ($(tdd), yes)
libobjc_CPPFLAGS += -DTYPE_DEPENDENT_DISPATCH
endif
libobjc_LIBRARIES_DEPEND_UPON += -lpthread
libobjc_LIBRARIES_DEPEND_UPON += -lpthread -ltoydispatch
# Deprecated functions are only deprecated for external use, not for us because
# we are special, precious, little flowers.
@ -62,7 +62,7 @@ libobjc_CPPFLAGS += -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500
# benefit from supporting platforms with no C99 compiler.
libobjc_CFLAGS += -std=c99 -g -march=native -fexceptions -fno-inline
libobjc_OBJCFLAGS += $(libobjc_CFLAGS)
libobjc_LDFLAGS += -g -ltoydispatch
libobjc_LDFLAGS += -g
libobjc_LIB_DIRS += -L toydispatch/obj
libobjc_CFLAGS += -O3

View File

@ -14,10 +14,17 @@ void *objc_atomic_malloc(size_t size)
return malloc(size);
}
#ifdef __MINGW32__
void *objc_valloc(size_t size)
{
return malloc(size);
}
#else
void *objc_valloc(size_t size)
{
return valloc(size);
}
#endif
void *objc_realloc(void *mem, size_t size)
{

View File

@ -2,6 +2,15 @@
#include <stdio.h>
#include <unistd.h>
#ifdef __MINGW32__
#include <windows.h>
static unsigned sleep(unsigned seconds)
{
Sleep(seconds*1000);
return 0;
}
#endif
// Subset of NSObject interface needed for properties.
@interface NSObject {}
- (id)retain;