diff options
-rw-r--r-- | TSRM/Makefile | 7 | ||||
-rw-r--r-- | TSRM/TSRM.c | 8 | ||||
-rw-r--r-- | TSRM/TSRM.h | 12 | ||||
-rw-r--r-- | Zend/Makefile.am | 3 | ||||
-rw-r--r-- | Zend/zend-scanner.l | 6 |
5 files changed, 31 insertions, 5 deletions
diff --git a/TSRM/Makefile b/TSRM/Makefile new file mode 100644 index 0000000000..9a91e1a307 --- /dev/null +++ b/TSRM/Makefile @@ -0,0 +1,7 @@ +CC = gcc +CFLAGS = -O2 -DPTHREADS -DHAVE_STDARG_H=1 +OBJS = TSRM.o +AR = ar + +libtsrm.a: $(OBJS) + $(AR) cru libtsrm.a $(OBJS) diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c index 50928562e4..364ce4b240 100644 --- a/TSRM/TSRM.c +++ b/TSRM/TSRM.c @@ -17,6 +17,10 @@ #include "TSRM.h" #include <stdio.h> +#if HAVE_STDARG_H +#include <stdarg.h> +#endif + typedef struct _tsrm_tls_entry tsrm_tls_entry; struct _tsrm_tls_entry { @@ -142,7 +146,7 @@ TSRM_FUNC ts_rsrc_id ts_allocate_id(size_t size, void (*ctor)(void *resource), v if (p->count < id_count) { int j; - p->storage = realloc(p->storage, sizeof(void *)*id_count); + p->storage = (void *) realloc(p->storage, sizeof(void *)*id_count); for (j=p->count; j<id_count; j++) { p->storage[j] = (void *) malloc(resource_types_table[j].size); if (resource_types_table[j].ctor) { @@ -384,4 +388,4 @@ static int tsrm_debug(const char *format, ...) void tsrm_debug_set(int status) { tsrm_debug_status = status; -}
\ No newline at end of file +} diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index aec84fe7e6..a3ba6c25c1 100644 --- a/TSRM/TSRM.h +++ b/TSRM/TSRM.h @@ -17,7 +17,15 @@ #ifndef _TSRM_H #define _TSRM_H -#include <windows.h> +#if !(WIN32||WINNT) +# define PTHREADS +#endif + +#if WIN32||WINNT +# include <windows.h> +#elif defined(PTHREADS) +# include <pthread.h> +#endif typedef int ts_rsrc_id; @@ -76,4 +84,4 @@ TSRM_FUNC void tsrm_mutex_free(MUTEX_T mutexp); TSRM_FUNC int tsrm_mutex_lock(MUTEX_T mutexp); TSRM_FUNC int tsrm_mutex_unlock(MUTEX_T mutexp); -#endif /* _TSRM_H */
\ No newline at end of file +#endif /* _TSRM_H */ diff --git a/Zend/Makefile.am b/Zend/Makefile.am index dbc3b8d49d..cb98bdb721 100644 --- a/Zend/Makefile.am +++ b/Zend/Makefile.am @@ -14,6 +14,9 @@ libzend_a_SOURCES=\ zend-scanner.c: zend-scanner.l $(LEX) -Pzend -ozend-scanner.c -i zend-scanner.l +zend-scanner.cc: zend-scanner.l + $(LEX) -+ -Sflex.skl -Pzend -ozend-scanner.cc -i zend-scanner.l + zend-parser.h: zend-parser.c zend-parser.c: zend-parser.y $(YACC) -p zend -v -d zend-parser.y -o zend-parser.c diff --git a/Zend/zend-scanner.l b/Zend/zend-scanner.l index 86c0f9fa7c..376b5ccbf0 100644 --- a/Zend/zend-scanner.l +++ b/Zend/zend-scanner.l @@ -36,7 +36,11 @@ #ifdef ZTS #include <fstream.h> -#include <strstrea.h> +# if WIN32||WINNT +# include <strstrea.h> +# else +# include <strstream.h> +# endif #endif #include "zend.h" |