diff options
author | Zeev Suraski <zeev@php.net> | 1999-04-24 09:01:30 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 1999-04-24 09:01:30 +0000 |
commit | 1e9ce9528d2bf27a2f7168efce2b09a6942ea5c9 (patch) | |
tree | 9a438627de250473dde20392f6f11b0e12b00821 /TSRM | |
parent | 5a5806e02a480987b4655706ea1af44c8756f129 (diff) | |
download | php-git-1e9ce9528d2bf27a2f7168efce2b09a6942ea5c9.tar.gz |
*** empty log message ***
Diffstat (limited to 'TSRM')
-rw-r--r-- | TSRM/Makefile | 7 | ||||
-rw-r--r-- | TSRM/TSRM.c | 8 | ||||
-rw-r--r-- | TSRM/TSRM.h | 12 |
3 files changed, 23 insertions, 4 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 */ |