Skip to content

Commit

Permalink
refs #1273: fixed compilation on MinGW and Cygwin
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.modelica.org/projects/Modelica/trunk@7086 7ce873d0-865f-4ce7-a662-4bb36ea78beb
  • Loading branch information
beutlich committed Oct 17, 2013
1 parent 1f08824 commit 8a6439a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions Modelica/Resources/C-Sources/ModelicaStandardTables.c
Expand Up @@ -3828,7 +3828,7 @@ static double* readTxtTable(const char* tableName, const char* fileName,
unsigned long lineNo = 1;
#if defined(_MSC_VER) && _MSC_VER >= 1400
_locale_t loc;
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
locale_t loc;
#else
char* dec;
Expand Down Expand Up @@ -3894,7 +3894,7 @@ static double* readTxtTable(const char* tableName, const char* fileName,

#if defined(_MSC_VER) && _MSC_VER >= 1400
loc = _create_locale(LC_NUMERIC, "C");
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
loc = newlocale(LC_NUMERIC, "C", NULL);
#else
dec = localeconv()->decimal_point;
Expand Down Expand Up @@ -3930,7 +3930,7 @@ static double* readTxtTable(const char* tableName, const char* fileName,
}
#if defined(_MSC_VER) && _MSC_VER >= 1400
nRow = (unsigned long)_strtol_l(token, &endptr, 10, loc);
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
nRow = (unsigned long)strtol_l(token, &endptr, 10, loc);
#else
nRow = (unsigned long)strtol(token, &endptr, 10);
Expand All @@ -3944,7 +3944,7 @@ static double* readTxtTable(const char* tableName, const char* fileName,
}
#if defined(_MSC_VER) && _MSC_VER >= 1400
nCol = (unsigned long)_strtol_l(token, &endptr, 10, loc);
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
nCol = (unsigned long)strtol_l(token, &endptr, 10, loc);
#else
nCol = (unsigned long)strtol(token, &endptr, 10);
Expand All @@ -3965,7 +3965,7 @@ static double* readTxtTable(const char* tableName, const char* fileName,
fclose(fp);
#if defined(_MSC_VER) && _MSC_VER >= 1400
_free_locale(loc);
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
freelocale(loc);
#endif
ModelicaError("Memory allocation error\n");
Expand Down Expand Up @@ -4005,7 +4005,7 @@ static double* readTxtTable(const char* tableName, const char* fileName,
if (*endptr != 0) {
tableReadError = 1;
}
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
TABLE(i, j) = strtod_l(token, &endptr, loc);
if (*endptr != 0) {
tableReadError = 1;
Expand Down Expand Up @@ -4067,7 +4067,7 @@ static double* readTxtTable(const char* tableName, const char* fileName,
fclose(fp);
#if defined(_MSC_VER) && _MSC_VER >= 1400
_free_locale(loc);
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
freelocale(loc);
#endif
if (foundTable == 0) {
Expand Down
8 changes: 4 additions & 4 deletions Modelica/Resources/C-Sources/ModelicaStrings.c
Expand Up @@ -261,7 +261,7 @@ MODELICA_EXPORT void ModelicaStrings_scanInteger(const char* string, int startIn
&& string[next] != 'E') ) {
#if defined(_MSC_VER) && _MSC_VER >= 1400
_locale_t loc = _create_locale(LC_NUMERIC, "C");
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
locale_t loc = newlocale(LC_NUMERIC, "C", NULL);
#endif
char buf[MAX_TOKEN_SIZE+1];
Expand All @@ -276,7 +276,7 @@ MODELICA_EXPORT void ModelicaStrings_scanInteger(const char* string, int startIn
#if defined(_MSC_VER) && _MSC_VER >= 1400
x = (int)_strtol_l(buf, &endptr, 10, loc);
_free_locale(loc);
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
x = (int)strtol_l(buf, &endptr, 10, loc);
freelocale(loc);
#else
Expand Down Expand Up @@ -367,7 +367,7 @@ MODELICA_EXPORT void ModelicaStrings_scanReal(const char* string, int startIndex
if (total_length > 0 && total_length < MAX_TOKEN_SIZE) {
#if defined(_MSC_VER) && _MSC_VER >= 1400
_locale_t loc = _create_locale(LC_NUMERIC, "C");
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
locale_t loc = newlocale(LC_NUMERIC, "C", NULL);
#else
char* dec = localeconv()->decimal_point;
Expand All @@ -384,7 +384,7 @@ MODELICA_EXPORT void ModelicaStrings_scanReal(const char* string, int startIndex
#if defined(_MSC_VER) && _MSC_VER >= 1400
x = _strtod_l(buf, &endptr, loc);
_free_locale(loc);
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 6 && __GLIBC_PREREQ(2, 3)
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 3)
x = strtod_l(buf, &endptr, loc);
freelocale(loc);
#else
Expand Down

0 comments on commit 8a6439a

Please sign in to comment.