diff --git a/build/WinSDK/Readme.txt b/build/WinSDK/Readme.txt deleted file mode 100644 index c7d5f1c..0000000 --- a/build/WinSDK/Readme.txt +++ /dev/null @@ -1,17 +0,0 @@ -For compiling EPANET2.DLL : - -Open the EPANET.C file and make sure that the line - #define DLL - is not commented out while the lines - #define CLE - #define SOL - are commented out. - -For compiling EPANET2.EXE : - -Open the EPANET.C file and make sure that the line - #define CLE - is not commented out while the lines - #define DLL - #define SOL - are commented out. diff --git a/build/WinSDK/dll_win_make.bat b/build/WinSDK/dll_win_make.bat deleted file mode 100644 index 611b64f..0000000 --- a/build/WinSDK/dll_win_make.bat +++ /dev/null @@ -1,11 +0,0 @@ -rem : set path to Windows SDK -SET SDK_PATH="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\" - -rem : set path for source EPANET files -SET SRC_PATH="D:\Projects\EPANET\Open Source\Code\owa\EPANET\src" - -CALL %SDK_PATH%SetEnv.cmd /x86 /release -CHDIR /D %SRC_PATH% - -rem : do the magic ... -cl -o epanet2.dll epanet.c hash.c hydraul.c inpfile.c input1.c input2.c input3.c mempool.c output.c quality.c report.c rules.c smatrix.c /I ..\include /I ..\run /link /DLL /def:epanet2.def /MAP \ No newline at end of file diff --git a/build/WinSDK/exe_win_make.bat b/build/WinSDK/exe_win_make.bat deleted file mode 100644 index d068859..0000000 --- a/build/WinSDK/exe_win_make.bat +++ /dev/null @@ -1,11 +0,0 @@ -rem : set path to Windows SDK -SET SDK_PATH="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\" - -rem : set path for source EPANET files -SET SRC_PATH="D:\Projects\EPANET\Open Source\Code\owa\EPANET\src" - -CALL %SDK_PATH%SetEnv.cmd /x86 /release -CHDIR /D %SRC_PATH% - -rem : do the magic ... -cl -o epanet2.exe ..\run\main.c /I ..\include /I ..\run /I ..\src /link \ No newline at end of file diff --git a/build/WinSDK/win_make.bat b/build/WinSDK/win_make.bat new file mode 100644 index 0000000..321dd7f --- /dev/null +++ b/build/WinSDK/win_make.bat @@ -0,0 +1,22 @@ +rem : set path to Windows SDK +SET SDK_PATH="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\" + +rem : set path for source EPANET files +SET SRC_PATH="D:\Projects\EPANET\Open Source\Code\owa\EPANET\src" + +CALL %SDK_PATH%SetEnv.cmd /x86 /release +CHDIR /D %SRC_PATH% +del %SRC_PATH%\*.dll +del %SRC_PATH%\*.exe + +rem : do the magic ... + rem : creat EPANET2.DLL + cl -o epanet2.dll epanet.c hash.c hydraul.c inpfile.c input1.c input2.c input3.c mempool.c output.c quality.c report.c rules.c smatrix.c /I ..\include /I ..\run /link /DLL /def:epanet2.def /MAP + rem : creat EPANET2.EXE + cl -o epanet2.exe epanet.c ..\run\main.c hash.c hydraul.c inpfile.c input1.c input2.c input3.c mempool.c output.c quality.c report.c rules.c smatrix.c /I ..\include /I ..\run /I ..\src /link + +rem : a bit of housekeeping and cleaning +del %SRC_PATH%\*.obj +del %SRC_PATH%\*.exp +del %SRC_PATH%\*.lib +del %SRC_PATH%\*.map diff --git a/include/epanet2.h b/include/epanet2.h index 2a5b312..8527d83 100755 --- a/include/epanet2.h +++ b/include/epanet2.h @@ -22,6 +22,16 @@ #define EN_API_FLOAT_TYPE float #endif +// --- define WINDOWS +#undef WINDOWS +#ifdef _WIN32 + #define WINDOWS +#endif +#ifdef __WIN32__ + #define WINDOWS +#endif + +// --- define DLLEXPORT #ifndef DLLEXPORT #ifdef WINDOWS #ifdef __cplusplus