Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd5d7f7f

Browse files
committed
Silence MSVC warnings about redefinition of isnan
Some versions of perl.h define isnan when the compiler is MSVC. To avoidwarnings about this, undefine the symbol before including perl.h andre-add the definition afterwards if it wasn't recreated.Discussion:https://postgr.es/m/caf0568e-3c1f-07fd-6914-d903f22560f2@2ndQuadrant.com
1 parent0b59b0e commitd5d7f7f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎src/pl/plperl/plperl.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,15 @@
4040

4141
/*
4242
* ActivePerl 5.18 and later are MinGW-built, and their headers use GCC's
43-
* __inline__. Translate to something MSVC recognizes.
43+
* __inline__. Translate to something MSVC recognizes. Also, perl.h sometimes
44+
* defines isnan, so undefine it here and put back the definition later if
45+
* perl.h doesn't.
4446
*/
4547
#ifdef_MSC_VER
4648
#define__inline__ inline
49+
#ifdefisname
50+
#undef isnan
51+
#endif
4752
#endif
4853

4954
/*
@@ -135,6 +140,13 @@
135140
#definevprintfpg_vprintf
136141
#defineprintf(...)pg_printf(__VA_ARGS__)
137142

143+
/* put back the definition of isnan if needed */
144+
#ifdef_MSC_VER
145+
#ifndefisnan
146+
#defineisnan(x) _isnan(x)
147+
#endif
148+
#endif
149+
138150
/* perl version and platform portability */
139151
#defineNEED_eval_pv
140152
#defineNEED_newRV_noinc

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp