Making epanet exports opt in

This commit is contained in:
Michael Tryby
2018-09-04 11:53:53 -04:00
parent b2aa8de927
commit b9a1934879
2 changed files with 8 additions and 13 deletions

View File

@@ -80,6 +80,7 @@ target_include_directories(epanet PUBLIC ${PROJECT_SOURCE_DIR}/include)
# create export lib so we can link against dll using Visual Studio # create export lib so we can link against dll using Visual Studio
add_definitions(-DWITH_GENX)
include(GenerateExportHeader) include(GenerateExportHeader)
GENERATE_EXPORT_HEADER(epanet GENERATE_EXPORT_HEADER(epanet
BASE_NAME epanet BASE_NAME epanet

View File

@@ -30,7 +30,9 @@
#define EN_API_FLOAT_TYPE float #define EN_API_FLOAT_TYPE float
#endif #endif
#ifdef NO_GENX #ifdef WITH_GENX
#include "epanet_export.h"
#else
// --- define WINDOWS // --- define WINDOWS
#undef WINDOWS #undef WINDOWS
#ifdef _WIN32 #ifdef _WIN32
@@ -60,8 +62,6 @@
#define DLLEXPORT #define DLLEXPORT
#endif #endif
#endif #endif
#else
#include "epanet_export.h"
#endif #endif
@@ -932,15 +932,6 @@ extern "C" {
@see ENgetbasedemand @see ENgetbasedemand
*/ */
int DLLEXPORT ENsetbasedemand(int nodeIndex, int demandIdx, EN_API_FLOAT_TYPE baseDemand); int DLLEXPORT ENsetbasedemand(int nodeIndex, int demandIdx, EN_API_FLOAT_TYPE baseDemand);
/**
@brief Sets the index of the demand pattern assigned to a node for a category index.
@param nodeIndex The index of a node (first node is index 1).
@param demandIndex The index of a category (first category is index 1).
@param pattIndex The index of the pattern for this node and category.
@return Error code
*/
int DLLEXPORT ENsetdemandpattern(int nodeIndex, int demandIdx, int patIndex);
/** /**
@brief Retrieves index of curve with specific ID. @brief Retrieves index of curve with specific ID.
@@ -1179,6 +1170,9 @@ extern "C" {
***************************************************/ ***************************************************/
int DLLEXPORT EN_createproject(EN_ProjectHandle *ph); int DLLEXPORT EN_createproject(EN_ProjectHandle *ph);
int DLLEXPORT EN_deleteproject(EN_ProjectHandle *ph); int DLLEXPORT EN_deleteproject(EN_ProjectHandle *ph);
int DLLEXPORT EN_runproject(EN_ProjectHandle ph, const char *inpFile,
const char *rptFile, const char *binOutFile, void (*callback) (char *));
void DLLEXPORT EN_clearError(EN_ProjectHandle ph); void DLLEXPORT EN_clearError(EN_ProjectHandle ph);
int DLLEXPORT EN_checkError(EN_ProjectHandle ph, char** msg_buffer); int DLLEXPORT EN_checkError(EN_ProjectHandle ph, char** msg_buffer);
@@ -1274,7 +1268,7 @@ extern "C" {
int DLLEXPORT EN_getqualinfo(EN_ProjectHandle ph, int *qualcode, char *chemname, char *chemunits, int *tracenode); int DLLEXPORT EN_getqualinfo(EN_ProjectHandle ph, int *qualcode, char *chemname, char *chemunits, int *tracenode);
int DLLEXPORT EN_setbasedemand(EN_ProjectHandle ph, int nodeIndex, int demandIdx, EN_API_FLOAT_TYPE baseDemand); int DLLEXPORT EN_setbasedemand(EN_ProjectHandle ph, int nodeIndex, int demandIdx, EN_API_FLOAT_TYPE baseDemand);
int DLLEXPORT EN_setdemandpattern(EN_ProjectHandle ph, int nodeIndex, int demandIdx, int patIndex); int DLLEXPORT EN_setdemandpattern(EN_ProjectHandle ph, int nodeIndex, int demandIdx, int patIndex);
int DLLEXPORT EN_getcurveindex(EN_ProjectHandle ph, char *id, int *index); int DLLEXPORT EN_getcurveindex(EN_ProjectHandle ph, char *id, int *index);
int DLLEXPORT EN_getcurveid(EN_ProjectHandle ph, int index, char *id); int DLLEXPORT EN_getcurveid(EN_ProjectHandle ph, int index, char *id);
int DLLEXPORT EN_getcurvelen(EN_ProjectHandle ph, int index, int *len); int DLLEXPORT EN_getcurvelen(EN_ProjectHandle ph, int index, int *len);