8000 Recognize that MSVC can support strtoll() and strtoull(). · limezra/postgres@cf39aeb · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Commit cf39aeb

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 29ce500 commit cf39aeb

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
@@ -357,13 +357,25 @@
357357
#define HAVE_STRONG_RANDOM 1
358358

359359
/* Define to 1 if you have the `strtoll' function. */
360-
//#define HAVE_STRTOLL 1
360+
#ifdef HAVE_LONG_LONG_INT_64
361+
#define HAVE_STRTOLL 1
362+
/* Before VS2013, use Microsoft's nonstandard equivalent function */
363+
#if (_MSC_VER < 1800)
364+
#define strtoll _strtoi64
365+
#endif
366+
#endif
361367

362368
/* Define to 1 if you have the `strtoq' function. */
363369
/* #undef HAVE_STRTOQ */
364370

365371
/* Define to 1 if you have the `strtoull' function. */
366-
//#define HAVE_STRTOULL 1
372+
#ifdef HAVE_LONG_LONG_INT_64
373+
#define HAVE_STRTOULL 1
374+
/* Before VS2013, use Microsoft's nonstandard equivalent function */
375+
#if (_MSC_VER < 1800)
376+
#define strtoull _strtoui64
377+
#endif
378+
#endif
367379

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

0 commit comments

Comments
 (0)
0