From: jake Date: Thu, 20 Jun 2002 00:21:03 +0000 (+0000) Subject: More Win32 build changes; thanks to Kerry Calvert. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3c6f40dc07acfbcb48480e4b3153a5f42f6e96fe;p=rrdtool.git More Win32 build changes; thanks to Kerry Calvert. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@146 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/NT-BUILD-TIPS.txt b/NT-BUILD-TIPS.txt index 9c35d44..0545116 100644 --- a/NT-BUILD-TIPS.txt +++ b/NT-BUILD-TIPS.txt @@ -18,7 +18,8 @@ configure script-- but of course not on Win32 platforms). ..\..\confignt (which contains a static Win32 version of config.h) should be on the include path. (4) Fonts are located in the %windir%\fonts, so the default font -is c:\winnt\fonts\cour.ttf. +is c:\winnt\fonts\cour.ttf. (6/19/02) At Kerry Calvert's suggestion +this setting was moved to confignt\config.h. (5) libart requires a custom build step to generate art_config.h; this is done manually via the commands: cl -I..\..\confignt gen_art_config.c diff --git a/bindings/perl-shared/RRDs.xs b/bindings/perl-shared/RRDs.xs index a0001f7..1340b6f 100644 --- a/bindings/perl-shared/RRDs.xs +++ b/bindings/perl-shared/RRDs.xs @@ -17,6 +17,7 @@ extern "C" { #define PL_sv_undef sv_undef #endif + #define rrdcode(name) \ argv = (char **) malloc((items+1)*sizeof(char *));\ argv[0] = "dummy";\ @@ -149,16 +150,16 @@ rrd_graph(...) if (rrd_test_error()) { if(calcpr) for(i=0;calcpr[i];i++) - free(calcpr[i]); + rrd_freemem(calcpr[i]); XSRETURN_UNDEF; } retar=newAV(); if(calcpr){ for(i=0;calcpr[i];i++){ av_push(retar,newSVpv(calcpr[i],0)); - free(calcpr[i]); + rrd_freemem(calcpr[i]); } - free(calcpr); + rrd_freemem(calcpr); } EXTEND(sp,4); PUSHs(sv_2mortal(newRV_noinc((SV*)retar))); @@ -198,9 +199,9 @@ rrd_fetch(...) names=newAV(); for (ii = 0; ii < ds_cnt; ii++){ av_push(names,newSVpv(ds_namv[ii],0)); - free(ds_namv[ii]); + rrd_freemem(ds_namv[ii]); } - free(ds_namv); + rrd_freemem(ds_namv); /* convert the data array into perl format */ datai=data; retar=newAV(); @@ -212,7 +213,7 @@ rrd_fetch(...) } av_push(retar,newRV_noinc((SV*)line)); } - free(data); + rrd_freemem(data); EXTEND(sp,5); PUSHs(sv_2mortal(newSViv(start+step))); PUSHs(sv_2mortal(newSViv(step))); @@ -254,9 +255,9 @@ rrd_xport(...) names=newAV(); for (ii = 0; ii < col_cnt; ii++){ av_push(names,newSVpv(legend_v[ii],0)); - free(legend_v[ii]); + rrd_freemem(legend_v[ii]); } - free(legend_v); + rrd_freemem(legend_v); /* convert the data array into perl format */ ptr=data; @@ -269,7 +270,7 @@ rrd_xport(...) } av_push(retar,newRV_noinc((SV*)line)); } - free(data); + rrd_freemem(data); EXTEND(sp,7); PUSHs(sv_2mortal(newSViv(start+step))); @@ -325,15 +326,15 @@ rrd_info(...) break; case RD_I_STR: hvs(newSVpv(data->value.u_str,0)); - free(data->value.u_str); + rrd_freemem(data->value.u_str); break; } #undefine hvs - free(data->key); + rrd_freemem(data->key); data = data->next; - free(save); + rrd_freemem(save); } - free(data); + rrd_freemem(data); RETVAL = newRV_noinc((SV*)hash); OUTPUT: RETVAL diff --git a/bindings/perl-shared/ntmake.pl b/bindings/perl-shared/ntmake.pl index 7a4938c..abaf919 100644 --- a/bindings/perl-shared/ntmake.pl +++ b/bindings/perl-shared/ntmake.pl @@ -11,9 +11,10 @@ WriteMakefile( # 'DEFINE' => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL}", 'DEFINE' => "-DPERLPATCHLEVEL=5", - 'INC' => '-I../../src/ -I../../libraries/freetype-2.0.5/include -I ../../libraries/libart_lgpl-2.3.7 -I ../../libraries/zlib-1.1.4 -I ../../libraries/libpng-1.2.0', + 'INC' => '-I../../src/ -I../../libraries/freetype-2.0.5/include -I ../../libraries/libart_lgpl-2.3.7 -I ../../libraries/zlib-1.1.4 -I ../../libraries/libpng-1.2.0', + 'OPTIMIZE' => '-O2 -MT', # change this path to refer to your libc.lib - 'MYEXTLIB' => 'e:/micros~1.net/vc7/lib/libcmt.lib ../../src/release/rrd.lib ../../libraries/libart_lgpl-2.3.7/release/libart.lib ../../libraries/zlib-1.1.4/release/zlib.lib ../../libraries/libpng-1.2.0\release\png.lib ../../libraries/freetype-2.0.5/release/freetype.lib', + 'MYEXTLIB' => 'c:/vc98/lib/libcmt.lib ../../src/release/rrd.lib ../../libraries/libart_lgpl-2.3.7/release/libart.lib ../../libraries/zlib-1.1.4/release/zlib.lib ../../libraries/libpng-1.2.0\release\png.lib ../../libraries/freetype-2.0.5/release/freetype.lib', 'realclean' => {FILES => 't/demo?.rrd t/demo?.png' }, ($] ge '5.005') ? ( 'AUTHOR' => 'Tobias Oetiker (oetiker@ee.ethz.ch)', diff --git a/confignt/config.h b/confignt/config.h index 4e4c37c..f31bba1 100644 --- a/confignt/config.h +++ b/confignt/config.h @@ -14,3 +14,6 @@ #define rrd_realloc(a,b) realloc((a), (b)) #define snprintf _snprintf + +/* change this to %windir%/fonts */ +#define RRD_DEFAULT_FONT "c:/winnt/fonts/cour.ttf" diff --git a/libraries/freetype-2.0.5/freetype.dsp b/libraries/freetype-2.0.5/freetype.dsp index 50ad9f7..5262a5e 100644 --- a/libraries/freetype-2.0.5/freetype.dsp +++ b/libraries/freetype-2.0.5/freetype.dsp @@ -41,8 +41,8 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /I "include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /O /YX +# ADD CPP /nologo /MT /W3 /GX /I "include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /i "include" /d "NDEBUG" BSC32=bscmake.exe @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /I "include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/libraries/libart_lgpl-2.3.7/libart.dsp b/libraries/libart_lgpl-2.3.7/libart.dsp index 14633f1..9c1665f 100644 --- a/libraries/libart_lgpl-2.3.7/libart.dsp +++ b/libraries/libart_lgpl-2.3.7/libart.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /I "..\..\confignt" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "LIBART_COMPILATION" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /I "..\..\confignt" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "LIBART_COMPILATION" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -64,7 +64,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /I "..\..\confignt" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "LIBART_COMPILATION" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\confignt" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "LIBART_COMPILATION" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/libraries/libpng-1.2.0/png.dsp b/libraries/libpng-1.2.0/png.dsp index 7a8ebd5..85491e5 100644 --- a/libraries/libpng-1.2.0/png.dsp +++ b/libraries/libpng-1.2.0/png.dsp @@ -41,8 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /I "..\zlib-1.1.3" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# SUBTRACT CPP /O +# ADD CPP /nologo /MT /W3 /GX /I "..\zlib-1.1.3" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -65,7 +64,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /I "..\zlib-1.1.3" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\zlib-1.1.3" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/libraries/zlib-1.1.4/zlib.dsp b/libraries/zlib-1.1.4/zlib.dsp index c443829..a3357c6 100644 --- a/libraries/zlib-1.1.4/zlib.dsp +++ b/libraries/zlib-1.1.4/zlib.dsp @@ -41,8 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# SUBTRACT CPP /O +# ADD CPP /nologo /MT /W3 /GX /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -65,7 +64,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/src/rrd.dsp b/src/rrd.dsp index c0a8ab3..d40a217 100644 --- a/src/rrd.dsp +++ b/src/rrd.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c +# ADD CPP /nologo /MT /W3 /GX /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c # SUBTRACT CPP /X /YX # ADD BASE RSC /l 0x100c # ADD RSC /l 0x100c @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c # SUBTRACT CPP /X /YX # ADD BASE RSC /l 0x100c # ADD RSC /l 0x100c diff --git a/src/rrd_open.c b/src/rrd_open.c index cf663ed..c0e6545 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -5,6 +5,9 @@ ***************************************************************************** * $Id$ * $Log$ + * Revision 1.5 2002/06/20 00:21:03 jake + * More Win32 build changes; thanks to Kerry Calvert. + * * Revision 1.4 2002/02/01 20:34:49 oetiker * fixed version number and date/time * @@ -131,6 +134,14 @@ void rrd_free(rrd_t *rrd) free(rrd->rrd_value); } +/* routine used by external libraries to free memory allocated by + * rrd library */ +void rrd_freemem(void *mem) +{ + + free(mem); +} + int readfile(char *file_name, char **buffer, int skipfirst){ long writecnt=0,totalcnt = MEMBLK; FILE *input=NULL; diff --git a/src/rrd_tool.h b/src/rrd_tool.h index 7280e74..f21a17a 100644 --- a/src/rrd_tool.h +++ b/src/rrd_tool.h @@ -160,6 +160,7 @@ int rrd_fetch_fn(char *filename, enum cf_en cf_idx, rrd_value_t **data); void rrd_free(rrd_t *rrd); +void rrd_freemem(void *mem); void rrd_init(rrd_t *rrd); int rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr); diff --git a/src/rrdtool.dsp b/src/rrdtool.dsp index b64e04f..ecffcc7 100644 --- a/src/rrdtool.dsp +++ b/src/rrdtool.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c +# ADD CPP /nologo /MT /W3 /GX /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x100c /d "NDEBUG" # ADD RSC /l 0x100c /d "NDEBUG" @@ -67,7 +67,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x100c /d "_DEBUG" # ADD RSC /l 0x100c /d "_DEBUG" diff --git a/src/rrdtool.ncb b/src/rrdtool.ncb deleted file mode 100644 index eb35de8..0000000 Binary files a/src/rrdtool.ncb and /dev/null differ