Skip to content

Commit 385f4ac

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 b5f096d commit 385f4ac

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
@@ -366,13 +366,25 @@
366366
#define HAVE_STRING_H 1
367367

368368
/* Define to 1 if you have the `strtoll' function. */
369-
//#define HAVE_STRTOLL 1
369+
#ifdef HAVE_LONG_LONG_INT_64
370+
#define HAVE_STRTOLL 1
371+
/* Before VS2013, use Microsoft's nonstandard equivalent function */
372+
#if (_MSC_VER < 1800)
373+
#define strtoll _strtoi64
374+
#endif
375+
#endif
370376

371377
/* Define to 1 if you have the `strtoq' function. */
372378
/* #undef HAVE_STRTOQ */
373379

374380
/* Define to 1 if you have the `strtoull' function. */
375-
//#define HAVE_STRTOULL 1
381+
#ifdef HAVE_LONG_LONG_INT_64
382+
#define HAVE_STRTOULL 1
383+
/* Before VS2013, use Microsoft's nonstandard equivalent function */
384+
#if (_MSC_VER < 1800)
385+
#define strtoull _strtoui64
386+
#endif
387+
#endif
376388

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

0 commit comments

Comments
 (0)