Changeset 1701
- Timestamp:
- Jan 23, 2007, 4:38:18 PM (16 years ago)
- Location:
- zzuf/trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/configure.ac
r1696 r1701 15 15 AC_PROG_LIBTOOL 16 16 17 AC_CHECK_HEADERS(inttypes.h stdint.h getopt.h libc.h malloc.h dlfcn.h regex.h sys/socket.h sys/uio.h aio.h sys/mman.h sys/wait.h sys/resource.h) 17 case "${host_os}" in 18 *mingw32*) 19 WIN32DLL_LDFLAGS="-Wl,-l,imagehlp" 20 ac_cv_func_recv=yes 21 ac_cv_func_recvfrom=yes 22 ac_cv_func_socket=yes 23 ac_cv_func_accept=yes 24 ;; 25 esac 26 AC_SUBST(WIN32DLL_LDFLAGS) 27 28 AC_CHECK_HEADERS(windows.h winsock2.h inttypes.h stdint.h getopt.h libc.h malloc.h dlfcn.h regex.h sys/socket.h sys/uio.h aio.h sys/mman.h sys/wait.h sys/resource.h) 29 18 30 AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 fseeko _IO_getc getline getdelim __getdelim fgetln __srefill map_fd memalign posix_memalign aio_read accept socket readv pread recv recvfrom recvmsg mmap valloc sigaction) 31 19 32 AC_CHECK_TYPES(sighandler_t, [], [], 20 33 [#define _GNU_SOURCE -
zzuf/trunk/src/Makefile.am
r1692 r1701 6 6 zzuf_SOURCES = zzuf.c $(COMMON) opts.c opts.h md5.c md5.h timer.c timer.h 7 7 zzuf_CFLAGS = -DLIBDIR=\"$(libdir)/zzuf\" 8 zzuf_LDFLAGS = @MATH_LIBS@8 zzuf_LDFLAGS = $(MATH_LIBS) 9 9 10 10 pkglib_LTLIBRARIES = libzzuf.la 11 libzzuf_la_SOURCES = libzzuf.c libzzuf.h $(COMMON) debug.c debug.h \11 libzzuf_la_SOURCES = libzzuf.c libzzuf.h $(COMMON) debug.c debug.h sys.c sys.h \ 12 12 lib-fd.c lib-mem.c lib-signal.c lib-stream.c lib-load.h 13 libzzuf_la_LDFLAGS = -avoid-version -no-undefined 14 libzzuf_la_LIBADD = @GETOPT_LIBS@ @DL_LIBS@ @MATH_LIBS@13 libzzuf_la_LDFLAGS = -avoid-version -no-undefined $(WIN32DLL_LDFLAGS) 14 libzzuf_la_LIBADD = $(GETOPT_LIBS) $(DL_LIBS) $(MATH_LIBS) 15 15 -
zzuf/trunk/src/lib-load.h
r1699 r1701 14 14 15 15 /* 16 * lib-load.h: preload edlibrary functions16 * lib-load.h: preload library functions 17 17 */ 18 18 … … 29 29 #define STR(x) #x 30 30 #define ORIG(x) x##_orig 31 #ifdef HAVE_DLFCN_H32 # define NEW(x) x33 #else34 # define NEW(x) x##_new35 #endif36 31 37 /* TODO: do the Win32 part */38 32 #ifdef HAVE_DLFCN_H 39 33 # include <dlfcn.h> 34 # define NEW(x) x 40 35 # define LOADSYM(x) \ 41 36 do { \ … … 46 41 } while(0) 47 42 #else 43 # define NEW(x) x##_new 48 44 # define LOADSYM(x) \ 49 45 do { \ 50 if(!ORIG(x)) \ 51 abort(); \ 46 /* Nothing to do */ \ 52 47 } while(0) 53 48 #endif -
zzuf/trunk/src/libzzuf.c
r1695 r1701 25 25 # include <inttypes.h> 26 26 #endif 27 #if defined HAVE_WINDOWS_H 28 # include <windows.h> 29 #endif 27 30 #include <stdio.h> 28 31 #include <sys/types.h> … … 37 40 #include "debug.h" 38 41 #include "fd.h" 42 #include "sys.h" 39 43 #include "fuzz.h" 44 45 /* Library initialisation shit */ 46 void _zz_init(void) __attribute__((constructor)); 47 void _zz_fini(void) __attribute__((destructor)); 48 #if defined HAVE_WINDOWS_H 49 BOOL WINAPI DllMain(HINSTANCE, DWORD, PVOID); 50 #endif 40 51 41 52 /* Global variables */ … … 97 108 98 109 _zz_fd_init(); 110 _zz_sys_init(); 99 111 100 112 tmp = getenv("ZZUF_STDIN"); … … 113 125 } 114 126 127 #if defined HAVE_WINDOWS_H 128 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, PVOID impLoad) 129 { 130 (void)hinst; /* unused */ 131 (void)impLoad; /* unused */ 132 133 switch(reason) 134 { 135 case DLL_PROCESS_ATTACH: 136 _zz_init(); 137 break; 138 case DLL_PROCESS_DETACH: 139 _zz_fini(); 140 break; 141 } 142 143 return TRUE; 144 } 145 #endif -
zzuf/trunk/src/libzzuf.h
r1671 r1701 54 54 extern int _zz_autoinc; 55 55 56 /* Library initialisation shit */57 extern void _zz_init(void) __attribute__((constructor));58 extern void _zz_fini(void) __attribute__((destructor));59 -
zzuf/trunk/src/zzuf.c
r1699 r1701 33 33 # include <regex.h> 34 34 #endif 35 #if defined HAVE_WINDOWS_H 36 # include <windows.h> 37 #endif 35 38 #if defined HAVE_WINSOCK2_H 36 39 # include <winsock2.h> 40 # include <io.h> 37 41 #endif 38 42 #include <string.h>
Note: See TracChangeset
for help on using the changeset viewer.