mirror of
https://github.com/darlinghq/darling-libobjc2.git
synced 2024-11-23 12:19:44 +00:00
libobjc2: tweaks to build on Windows
This commit is contained in:
parent
fe566cbc2f
commit
7a2c302c5f
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user