Skip to content

Commit

Permalink
- Only copy fmuWrapper.h to the include directory
Browse files Browse the repository at this point in the history
  - Moved some header includes around to avoid including unnecessary headers


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10167 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 20, 2011
1 parent 1da1595 commit 733f385
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion FMI/import/source/Makefile.in
Expand Up @@ -12,7 +12,7 @@ CXXINCS = -I"../include/"
BIN = ../../../build/bin/fmigenerator
LIB = ../../../build/lib/omc/libfmuWrapper.a
CXXFLAGS = $(CXXINCS)
CFLAGS = @CFLAGS@ -Wall
CFLAGS = @CFLAGS@ -Wall -pedantic
CPPFLAGS = -I"../../../build/include/omc"
RM = rm -f

Expand Down
25 changes: 14 additions & 11 deletions FMI/import/source/fmuWrapper.h
Expand Up @@ -6,7 +6,7 @@
#include "xmlparser.h"
#define COMBINENAME(a,b) a##_##b

// handling platform dependency
/* handling platform dependency */
#if defined(__MINGW32__) || defined(_MSC_VER)
#include <windows.h>
#define getFunctionPointerFromDLL GetProcAddress
Expand All @@ -28,7 +28,7 @@
extern "C"{
#endif

// typedef of function pointers to FMI interface functions
/* typedef of function pointers to FMI interface functions */
typedef const char* (*fGetModelTypesPlatform)();
typedef const char* (*fGetVersion)();
typedef fmiComponent (*fInstantiateModel)(fmiString instanceName, fmiString GUID,
Expand Down Expand Up @@ -56,9 +56,9 @@ typedef fmiStatus (*fGetNominalContinuousStates)(fmiComponent c, fmiReal x_nomin
typedef fmiStatus (*fGetStateValueReferences) (fmiComponent c, fmiValueReference vrx[], size_t nx);
typedef fmiStatus (*fTerminate) (fmiComponent c);

// typedef of the data structure FMI containing loaded FMI functions
/* typedef of the data structure FMI containing loaded FMI functions */
typedef struct {
ModelDescription* modelDescription;
void* modelDescription; /* ModelDescription* */
void* dllHandle;
fGetModelTypesPlatform getModelTypesPlatform;
fGetVersion getVersion;
Expand Down Expand Up @@ -149,7 +149,7 @@ void freeFMUFun(void* in_fmi);
void* fmuBooleanInst(int def_bool);
void freefmuBooleanInst(void* in_bool);

//void fmiFreeModelInst(void* in_fmufun, void* in_fmu);
/* void fmiFreeModelInst(void* in_fmufun, void* in_fmu); */
void fmiFreeModelInst(void* in_fmu);

void* fmiCallbackFuns();
Expand All @@ -164,20 +164,23 @@ void freeFMUDll(void* dummy);
void printVariables(const double * var, int n, const char* varName);
void printIntVariables(const int * var, int n, const char* varName);

/*
// void* fmiInstantiate(void* in_fmi, const char* instanceName, const char* GUID, void* in_functions, int logFlag);
// void fmiSetT(void* in_fmi, void* in_fmu, double t);
// void fmiGetContStates(void * /*_fmufun*/, void * /*_in_inst*/, double * /*_in_x*/, int);
// void fmiGetContStates(void *, void *, double *, int);
// void fmiGetDer(void* in_fmi, void* in_fmu, double* der_x, int nx, const double* x);
// void* instantiateFMIFun(const char* mid, const char* pathFMUDll);
// void fmiCompIntStep(void* in_fmi, void* in_fmu, void* in_stepEvt);
// void freeFMIfun(void* in_fmi);
// void printVariables(const double * /*_var*/, int /*_n*/, const char* /*_varName*/);
// void printVariables(const double *, int, const char*);
// // void fmiFreeModelInst(void* in_fmi, void* in_fmu);
// void fmiFreeModelInst(void* in_fmu);
// void fmiGetTimeEvent(void * /*_in_evtInfo*/, double /*_in_time*/, double /*_in_pretime*/, void * /*_in_timeEvt*/, double* /*_out_nextTime*/);
// void fmuStateEventCheck(void * /*_stateEvt*/, int /*_ni*/, const double * /*_z*/, const double * /*_prez*/);
// //signed char fmuStateEventCheck(void * /*_stateEvt*/, int /*_ni*/, const double * /*_z*/, const double * /*_prez*/);
// void fmuEventUpdate(void * /*_in_fmufun*/, void * /*_in_inst*/, void * /*_in_evtInfo*/, void * /*_timeEvt*/, void * /*_stepEvt*/, void * /*_stateEvt*/, void * /*_interMediateRes*/, double, double*);
// void fmiGetTimeEvent(void *, double, double, void *, double*);
// void fmuStateEventCheck(void *, int, const double *, const double *);
// //signed char fmuStateEventCheck(void *, int, const double *, const double *);
// void fmuEventUpdate(void *, void *, void *, void *, void *, void *, void *, double, double*);
*/

#ifdef __cplusplus
} //extern "C"
#endif
5 changes: 5 additions & 0 deletions FMI/import/source/xmlparser.c
Expand Up @@ -22,6 +22,11 @@
#include <assert.h>
#include <string.h>
#include "xmlparser.h"
// define XML_STATIC before including expat.h
// to prevent error when linking with libexpatMT.lib
#define XML_STATIC
#include <expat.h>
#include "stack.h"

// mocro for error message print
#define _IMPORT_ERROR_LOG_
Expand Down
5 changes: 0 additions & 5 deletions FMI/import/source/xmlparser.h
Expand Up @@ -9,12 +9,7 @@
#ifndef xmlparser_h
#define xmlparser_h

// define XML_STATIC before including expat.h
// to prevent error when linking with libexpatMT.lib
#define XML_STATIC
#include <expat.h>
#include <fmiModelTypes.h>
#include "stack.h"

#define SIZEOF_ELM 26
extern const char *elmNames[SIZEOF_ELM];
Expand Down
2 changes: 1 addition & 1 deletion Makefile.common
Expand Up @@ -51,7 +51,7 @@ docs: mkbuilddirs omlibrary

fmi: c_runtime
$(MAKE) -C FMI/import/source -f $(defaultMakefileTarget)
(cp -p FMI/import/source/fmuWrapper.h FMI/import/source/stack.h FMI/import/source/xmlparser.h $(builddir_inc))
(cp -p FMI/import/source/fmuWrapper.h $(builddir_inc))

breakprocess:
(cd testsuite/bootstrapping; time g++ BreakProcess.cpp -o BreakProcess -static-libgcc)
Expand Down

0 comments on commit 733f385

Please sign in to comment.