summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-04-24 09:01:30 +0000
committerZeev Suraski <zeev@php.net>1999-04-24 09:01:30 +0000
commit1e9ce9528d2bf27a2f7168efce2b09a6942ea5c9 (patch)
tree9a438627de250473dde20392f6f11b0e12b00821
parent5a5806e02a480987b4655706ea1af44c8756f129 (diff)
downloadphp-git-1e9ce9528d2bf27a2f7168efce2b09a6942ea5c9.tar.gz
*** empty log message ***
-rw-r--r--TSRM/Makefile7
-rw-r--r--TSRM/TSRM.c8
-rw-r--r--TSRM/TSRM.h12
-rw-r--r--Zend/Makefile.am3
-rw-r--r--Zend/zend-scanner.l6
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"