Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 25caeae

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 830e8e3 commit 25caeae

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
@@ -354,13 +354,25 @@
354354
#define HAVE_STRING_H 1
355355

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

359365
/* Define to 1 if you have the `strtoq' function. */
360366
/* #undef HAVE_STRTOQ */
361367

362368
/* Define to 1 if you have the `strtoull' function. */
363-
//#define HAVE_STRTOULL 1
369+
#ifdef HAVE_LONG_LONG_INT_64
370+
#define HAVE_STRTOULL 1
371+
/* Before VS2013, use Microsoft's nonstandard equivalent function */
372+
#if (_MSC_VER < 1800)
373+
#define strtoull _strtoui64
374+
#endif
375+
#endif
364376

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

0 commit comments

Comments
 (0)