1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-06 13:48:55 -04:00

dbdimp.c - Fix for Windows quadmath builds.

This commit is contained in:
sisyphus 2024-09-17 22:03:29 +10:00
parent 2ab93a4e41
commit c5374438f4

View file

@ -407,10 +407,16 @@ sqlite_is_number(pTHX_ const char *v, int sql_type)
if (sql_type != SQLITE_INTEGER) {
#ifdef USE_QUADMATH
sprintf(format, (has_plus ? "+%%.%dQf" : "%%.%dQf"), precision);
# if defined(WIN32)
/* On Windows quadmath, we need to use strtoflt128(), not atov() */
if (strEQ(form(format, strtoflt128(v, NULL)), v)) return 2;
# else
if (strEQ(form(format, atof(v)), v)) return 2;
# endif
#else
sprintf(format, (has_plus ? "+%%.%df" : "%%.%df" ), precision);
#endif
if (strEQ(form(format, atof(v)), v)) return 2;
#endif
}
return 0;
}