From: <sm...@us...> - 2009-03-03 07:21:29
|
Revision: 9664 http://plplot.svn.sourceforge.net/plplot/?rev=9664&view=rev Author: smekal Date: 2009-03-03 07:21:21 +0000 (Tue, 03 Mar 2009) Log Message: ----------- For Visual C++ getcwd and chdir must be redefined to _getcwd and _chdir. In addition direct.h must be included, where these functions are defined (only for Visual C++). Tested on Visual C++ and MinGW. Removed an unreferenced variable as well. Modified Paths: -------------- trunk/src/plcore.c Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2009-03-03 07:18:44 UTC (rev 9663) +++ trunk/src/plcore.c 2009-03-03 07:21:21 UTC (rev 9664) @@ -72,6 +72,18 @@ # endif #endif +/* AM: getcwd has a somewhat strange status on Windows, its proper + name is _getcwd, this is a problem in the case of DLLs, like with + the Java bindings. The functions _getcwd() and chdir() are + declared in direct.h for Visual C++. Since chdir() is deprecated + (but still available) in Visual C++ we redefine chdir to _chdir. +*/ +#if defined(_MSC_VER) +# include <direct.h> +# define getcwd _getcwd +# define chdir _chdir +#endif + #define BUFFER_SIZE 80 #define BUFFER2_SIZE 300 #define DRVSPEC_SIZE 400 @@ -425,7 +437,6 @@ { char *endptr; - char *endptr2; char msgbuf[BUFFER_SIZE]; *num = strtoul(text,&endptr,0); @@ -2171,14 +2182,6 @@ char currdir[PLPLOT_MAX_PATH]; char builddir[PLPLOT_MAX_PATH]; -/* AM: getcwd has a somewhat strange status on Windows, its proper - name is _getcwd, this is a problem in the case of DLLs, like with - the Java bindings. -*/ -#if defined(WIN32) && !defined(__BORLANDC__) -#define getcwd _getcwd -#endif - if (getcwd(currdir, PLPLOT_MAX_PATH) == NULL) { pldebug("plInBuildTree():", "Not enough buffer space"); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |