Skip to content

Commit 63d3e78

Browse files
committed
Recognize that MSVC can support strtoll() and strtoull().
This is needed for full support of "long long" variables in ecpg, but the previous patch for bug #15080 (commits 51057fe et al) missed it. In MSVC versions where the functions don't exist under those names, we can nonetheless use _strtoi64() and _strtoui64(). Like the previous patch, back-patch all the way. Dang Minh Huong Discussion: https://postgr.es/m/151935568942.1461.14623890240535309745@wrigleys.postgresql.org
1 parent 048caa5 commit 63d3e78

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/include/pg_config.h.win32

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,25 @@
375375
#define HAVE_STRING_H 1
376376

377377
/* Define to 1 if you have the `strtoll' function. */
378-
//#define HAVE_STRTOLL 1
378+
#ifdef HAVE_LONG_LONG_INT_64
379+
#define HAVE_STRTOLL 1
380+
/* Before VS2013, use Microsoft's nonstandard equivalent function */
381+
#if (_MSC_VER < 1800)
382+
#define strtoll _strtoi64
383+
#endif
384+
#endif
379385

380386
/* Define to 1 if you have the `strtoq' function. */
381387
/* #undef HAVE_STRTOQ */
382388

383389
/* Define to 1 if you have the `strtoull' function. */
384-
//#define HAVE_STRTOULL 1
390+
#ifdef HAVE_LONG_LONG_INT_64
391+
#define HAVE_STRTOULL 1
392+
/* Before VS2013, use Microsoft's nonstandard equivalent function */
393+
#if (_MSC_VER < 1800)
394+
#define strtoull _strtoui64
395+
#endif
396+
#endif
385397

386398
/* Define to 1 if you have the `strtouq' function. */
387399
/* #undef HAVE_STRTOUQ */

0 commit comments

Comments
 (0)