diff --git a/Modelica/Resources/C-Sources/ModelicaStandardTables.c b/Modelica/Resources/C-Sources/ModelicaStandardTables.c index b3c79353e3..2c307b0efa 100644 --- a/Modelica/Resources/C-Sources/ModelicaStandardTables.c +++ b/Modelica/Resources/C-Sources/ModelicaStandardTables.c @@ -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; @@ -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; @@ -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); @@ -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); @@ -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"); @@ -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; @@ -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) { diff --git a/Modelica/Resources/C-Sources/ModelicaStrings.c b/Modelica/Resources/C-Sources/ModelicaStrings.c index 357ea4fd8f..fa70c7b41e 100644 --- a/Modelica/Resources/C-Sources/ModelicaStrings.c +++ b/Modelica/Resources/C-Sources/ModelicaStrings.c @@ -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]; @@ -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 @@ -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; @@ -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