From 1e9ce9528d2bf27a2f7168efce2b09a6942ea5c9 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Sat, 24 Apr 1999 09:01:30 +0000 Subject: [PATCH] *** empty log message *** --- TSRM/Makefile | 7 +++++++ TSRM/TSRM.c | 8 ++++++-- TSRM/TSRM.h | 12 ++++++++++-- Zend/Makefile.am | 3 +++ Zend/zend-scanner.l | 6 +++++- 5 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 TSRM/Makefile 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 +#if HAVE_STDARG_H +#include +#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; jstorage[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 +#if !(WIN32||WINNT) +# define PTHREADS +#endif + +#if WIN32||WINNT +# include +#elif defined(PTHREADS) +# include +#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 -#include +# if WIN32||WINNT +# include +# else +# include +# endif #endif #include "zend.h" -- 2.50.1