--- /dev/null
+CC = gcc
+CFLAGS = -O2 -DPTHREADS -DHAVE_STDARG_H=1
+OBJS = TSRM.o
+AR = ar
+
+libtsrm.a: $(OBJS)
+ $(AR) cru libtsrm.a $(OBJS)
#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 {
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) {
void tsrm_debug_set(int status)
{
tsrm_debug_status = status;
-}
\ No newline at end of file
+}
#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;
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 */
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
#ifdef ZTS
#include <fstream.h>
-#include <strstrea.h>
+# if WIN32||WINNT
+# include <strstrea.h>
+# else
+# include <strstream.h>
+# endif
#endif
#include "zend.h"