Loading configure.in +15 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,12 @@ AC_SEARCH_LIBS(rt, nanosleep, , AC_SEARCH_LIBS(ws2_32, puts, , [AC_CHECK_LIB(ws2_32, puts, LIBS="$LIBS -lws2_32", , -lws2_32)]) AC_ARG_ENABLE([memdebug], [AS_HELP_STRING([--enable-memdebug], [compile nmxptool for debugging memory leaks])], [], [enable_memdebug=no] ) AC_ARG_ENABLE([libmseed], [AS_HELP_STRING([--disable-libmseed], [disable saving data in mini-SEED records])], [], Loading Loading @@ -100,6 +106,15 @@ AM_CONDITIONAL(ENABLE_WINSOURCES, test x$WINSOURCES != x) AM_PROG_LIBTOOL # memdebug check. AS_IF([test "x$enable_memdebug" != xno], [ CFLAGS="$CFLAGS -DNMXP_MEM_DEBUG" AC_MSG_WARN([memdebug has been enabled!]) ] ) AM_CONDITIONAL(ENABLE_MEMDEBUG, test x$enable_memdebug != xno) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h unistd.h]) Loading include/nmxp_memory.h +13 −0 Original line number Diff line number Diff line Loading @@ -14,9 +14,20 @@ #ifndef NMXP_MEMORY_H #define NMXP_MEMORY_H 1 #ifndef NMXP_MEM_DEBUG #define NMXP_MEM_MALLOC(size) malloc(size) #define NMXP_MEM_STRDUP(str) strdup(str) #define NMXP_MEM_FREE(ptr) free(ptr) #define NMXP_MEM_PRINT_PTR { } #else #define NMXP_MEM_MALLOC(size) nmxp_mem_malloc(size, __FILE__, __LINE__) #define NMXP_MEM_STRDUP(str) nmxp_mem_strdup(str, __FILE__, __LINE__) #define NMXP_MEM_FREE(ptr) nmxp_mem_free(ptr, __FILE__, __LINE__) #define NMXP_MEM_PRINT_PTR nmxp_mem_print_ptr() #include <stdlib.h> Loading Loading @@ -55,3 +66,5 @@ void nmxp_mem_print_ptr(); #endif #endif lib/nmxp_memory.c +4 −1 Original line number Diff line number Diff line Loading @@ -7,10 +7,12 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp_memory.c,v 1.2 2008-03-28 13:21:24 mtheo Exp $ * $Id: nmxp_memory.c,v 1.3 2008-03-28 16:27:15 mtheo Exp $ * */ #ifdef NMXP_MEM_DEBUG #include "nmxp_memory.h" #include "nmxp_log.h" Loading Loading @@ -169,4 +171,5 @@ void nmxp_mem_free(void *ptr, char *source_file, int line) { } } #endif Loading
configure.in +15 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,12 @@ AC_SEARCH_LIBS(rt, nanosleep, , AC_SEARCH_LIBS(ws2_32, puts, , [AC_CHECK_LIB(ws2_32, puts, LIBS="$LIBS -lws2_32", , -lws2_32)]) AC_ARG_ENABLE([memdebug], [AS_HELP_STRING([--enable-memdebug], [compile nmxptool for debugging memory leaks])], [], [enable_memdebug=no] ) AC_ARG_ENABLE([libmseed], [AS_HELP_STRING([--disable-libmseed], [disable saving data in mini-SEED records])], [], Loading Loading @@ -100,6 +106,15 @@ AM_CONDITIONAL(ENABLE_WINSOURCES, test x$WINSOURCES != x) AM_PROG_LIBTOOL # memdebug check. AS_IF([test "x$enable_memdebug" != xno], [ CFLAGS="$CFLAGS -DNMXP_MEM_DEBUG" AC_MSG_WARN([memdebug has been enabled!]) ] ) AM_CONDITIONAL(ENABLE_MEMDEBUG, test x$enable_memdebug != xno) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h unistd.h]) Loading
include/nmxp_memory.h +13 −0 Original line number Diff line number Diff line Loading @@ -14,9 +14,20 @@ #ifndef NMXP_MEMORY_H #define NMXP_MEMORY_H 1 #ifndef NMXP_MEM_DEBUG #define NMXP_MEM_MALLOC(size) malloc(size) #define NMXP_MEM_STRDUP(str) strdup(str) #define NMXP_MEM_FREE(ptr) free(ptr) #define NMXP_MEM_PRINT_PTR { } #else #define NMXP_MEM_MALLOC(size) nmxp_mem_malloc(size, __FILE__, __LINE__) #define NMXP_MEM_STRDUP(str) nmxp_mem_strdup(str, __FILE__, __LINE__) #define NMXP_MEM_FREE(ptr) nmxp_mem_free(ptr, __FILE__, __LINE__) #define NMXP_MEM_PRINT_PTR nmxp_mem_print_ptr() #include <stdlib.h> Loading Loading @@ -55,3 +66,5 @@ void nmxp_mem_print_ptr(); #endif #endif
lib/nmxp_memory.c +4 −1 Original line number Diff line number Diff line Loading @@ -7,10 +7,12 @@ * Istituto Nazionale di Geofisica e Vulcanologia - Italy * quintiliani@ingv.it * * $Id: nmxp_memory.c,v 1.2 2008-03-28 13:21:24 mtheo Exp $ * $Id: nmxp_memory.c,v 1.3 2008-03-28 16:27:15 mtheo Exp $ * */ #ifdef NMXP_MEM_DEBUG #include "nmxp_memory.h" #include "nmxp_log.h" Loading Loading @@ -169,4 +171,5 @@ void nmxp_mem_free(void *ptr, char *source_file, int line) { } } #endif