diff --git a/configure.ac b/configure.ac index d39879c3..021e7754 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,7 @@ if test "X$IPQ_FORTRAN" = "Xyes"; then echo "yes" AC_PROG_F77 AC_F77_LIBRARY_LDFLAGS + AC_F77_WRAPPERS else echo "no" fi diff --git a/src/fwrap.cpp b/src/fwrap.cpp index daa23bd7..ed8f1720 100644 --- a/src/fwrap.cpp +++ b/src/fwrap.cpp @@ -6,44 +6,6 @@ #include "phrqtype.h" #include "IPhreeqc.h" -/******************************* -When using GNU gcc/g++/g77 -compile fortran with: - g77 -fno-second-underscore -********************************/ -#if defined(__GNUC__) -#define AccumulateLineF accumulatelinef_ -#define CreateIPhreeqcF createiphreeqcf_ -#define DestroyIPhreeqcF destroyiphreeqcf_ -#define GetComponentCountF getcomponentcountf_ -#define GetComponentF getcomponentf_ -#define GetDumpLineCountF getdumplinecountf_ -#define GetDumpLineF getdumplinef_ -#define GetErrorLineCountF geterrorlinecountf_ -#define GetErrorLineF geterrorlinef_ -#define GetSelectedOutputColumnCountF getselectedoutputcolumncountf_ -#define GetSelectedOutputRowCountF getselectedoutputrowcountf_ -#define GetSelectedOutputValueF getselectedoutputvaluef_ -#define GetWarningLineCountF getwarninglinecountf_ -#define GetWarningLineF getwarninglinef_ -#define LoadDatabaseF loaddatabasef_ -#define LoadDatabaseStringF loaddatabasestringf_ -#define OutputLastErrorF outputlasterrorf_ -#define OutputLastWarningF outputlastwarningf_ -#define OutputLinesF outputlinesf_ -#define RunAccumulatedF runaccumulatedf_ -#define RunFileF runfilef_ -#define RunStringF runstringf_ -#define SetDumpOnF setdumponf_ -#define SetDumpStringOnF setdumpstringonf_ -#define SetErrorOnF seterroronf_ -#define SetLogOnF setlogonf_ -#define SetOutputOnF setoutputonf_ -#define SetSelectedOutputOnF setselectedoutputonf_ -#define UnLoadDatabaseF unloaddatabasef_ -//#define SystemF systemf_ -#endif - #include "fwrap.h" char * @@ -501,5 +463,5 @@ DLL_EXPORT int __stdcall GETSELECTEDOUTPUTVALUE(int *id, int *row, int *col, int } #endif -#endif +#endif // _WIN32 diff --git a/src/fwrap.h b/src/fwrap.h index 489469f2..914f3375 100644 --- a/src/fwrap.h +++ b/src/fwrap.h @@ -7,6 +7,38 @@ #define DLL_EXPORT #endif +#if defined(F77_FUNC) +#define CreateIPhreeqcF F77_FUNC (createiphreeqcf, CREATEIPHREEQCF) +#define DestroyIPhreeqcF F77_FUNC (destroyiphreeqcf, DESTROYIPHREEQCF) +#define LoadDatabaseF F77_FUNC (loaddatabasef, LOADDATABASEF) +#define LoadDatabaseStringF F77_FUNC (loaddatabasestringf, LOADDATABASESTRINGF) +#define UnLoadDatabaseF F77_FUNC (unloaddatabasef, UNLOADDATABASEF) +#define AccumulateLineF F77_FUNC (accumulatelinef, ACCUMULATELINEF) +#define RunAccumulatedF F77_FUNC (runaccumulatedf, RUNACCUMULATEDF) +#define RunFileF F77_FUNC (runfilef, RUNFILEF) +#define RunStringF F77_FUNC (runstringf, RUNSTRINGF) +#define GetSelectedOutputRowCountF F77_FUNC (getselectedoutputrowcountf, GETSELECTEDOUTPUTROWCOUNTF) +#define GetSelectedOutputColumnCountF F77_FUNC (getselectedoutputcolumncountf, GETSELECTEDOUTPUTCOLUMNCOUNTF) +#define GetSelectedOutputValueF F77_FUNC (getselectedoutputvaluef, GETSELECTEDOUTPUTVALUEF) +#define SetSelectedOutputOnF F77_FUNC (setselectedoutputonf, SETSELECTEDOUTPUTONF) +#define SetOutputOnF F77_FUNC (setoutputonf, SETOUTPUTONF) +#define SetErrorOnF F77_FUNC (seterroronf, SETERRORONF) +#define SetLogOnF F77_FUNC (setlogonf, SETLOGONF) +#define SetDumpOnF F77_FUNC (setdumponf, SETDUMPONF) +#define SetDumpStringOnF F77_FUNC (setdumpstringonf, SETDUMPSTRINGONF) +#define GetDumpLineCountF F77_FUNC (getdumplinecountf, GETDUMPLINECOUNTF) +#define GetDumpLineF F77_FUNC (getdumplinef, GETDUMPLINEF) +#define GetErrorLineCountF F77_FUNC (geterrorlinecountf, GETERRORLINECOUNTF) +#define GetErrorLineF F77_FUNC (geterrorlinef, GETERRORLINEF) +#define GetWarningLineCountF F77_FUNC (getwarninglinecountf, GETWARNINGLINECOUNTF) +#define GetWarningLineF F77_FUNC (getwarninglinef, GETWARNINGLINEF) +#define GetComponentCountF F77_FUNC (getcomponentcountf, GETCOMPONENTCOUNTF) +#define GetComponentF F77_FUNC (getcomponentf, GETCOMPONENTF) +#define OutputLastErrorF F77_FUNC (outputlasterrorf, OUTPUTLASTERRORF) +#define OutputLastWarningF F77_FUNC (outputlastwarningf, OUTPUTLASTWARNINGF) +#define OutputLinesF F77_FUNC (outputlinesf, OUTPUTLINESF) +#endif /* F77_FUNC */ + #if defined(__cplusplus) extern "C" { #endif