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

Commitf2c5870

Browse files
committed
Rethink how to get float.h in old Windows API for isnan/isinf
We include <float.h> in every place that needs isnan(), because MSVCused to require it. However, since MSVC 2013 that's no longer necessary(cf. commitcec8394), so we can retire the inclusion to aversion-specific stanza in win32_port.h, where it doesn't need topollute random .c files. The header is of course still needed in a fewplaces for other reasons.I (Álvaro) removed float.h from a few more files than in Emre's originalpatch. This doesn't break the build in my system, but we'll see whatthe buildfarm has to say about it all.Author: Emre HasegeliDiscussion:https://postgr.es/m/CAE2gYzyc0+5uG+Cd9-BSL7NKC8LSHLNg1Aq2=8ubjnUwut4_iw@mail.gmail.com
1 parenta01d0fa commitf2c5870

File tree

24 files changed

+7
-35
lines changed

24 files changed

+7
-35
lines changed

‎contrib/cube/cube.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include"postgres.h"
1010

11-
#include<float.h>
1211
#include<math.h>
1312

1413
#include"access/gist.h"

‎contrib/jsonb_plperl/jsonb_plperl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include"postgres.h"
22

3-
#include<float.h>
43
#include<math.h>
54

65
/* Defined by Perl */

‎contrib/tsm_system_time/tsm_system_time.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424

2525
#include"postgres.h"
2626

27-
#ifdef_MSC_VER
28-
#include<float.h>/* for _isnan */
29-
#endif
3027
#include<math.h>
3128

3229
#include"access/relscan.h"

‎src/backend/access/gist/gistproc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
#include"postgres.h"
1919

20-
#include<float.h>
2120
#include<math.h>
2221

2322
#include"access/gist.h"

‎src/backend/access/gist/gistutil.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414
#include"postgres.h"
1515

16-
#include<float.h>
1716
#include<math.h>
1817

1918
#include"access/gist_private.h"

‎src/backend/access/tablesample/bernoulli.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424

2525
#include"postgres.h"
2626

27-
#ifdef_MSC_VER
28-
#include<float.h>/* for _isnan */
29-
#endif
3027
#include<math.h>
3128

3229
#include"access/hash.h"

‎src/backend/access/tablesample/system.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424

2525
#include"postgres.h"
2626

27-
#ifdef_MSC_VER
28-
#include<float.h>/* for _isnan */
29-
#endif
3027
#include<math.h>
3128

3229
#include"access/hash.h"

‎src/backend/optimizer/path/costsize.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@
7171

7272
#include"postgres.h"
7373

74-
#ifdef_MSC_VER
75-
#include<float.h>/* for _isnan */
76-
#endif
7774
#include<math.h>
7875

7976
#include"access/amapi.h"

‎src/backend/utils/adt/arrayfuncs.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
#include"postgres.h"
1616

1717
#include<ctype.h>
18-
#ifdef_MSC_VER
19-
#include<float.h>/* for _isnan */
20-
#endif
2118
#include<math.h>
2219

2320
#include"access/hash.h"

‎src/backend/utils/adt/datetime.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include"postgres.h"
1616

1717
#include<ctype.h>
18-
#include<float.h>
1918
#include<limits.h>
2019
#include<math.h>
2120

‎src/backend/utils/adt/int8.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include"postgres.h"
1515

1616
#include<ctype.h>
17-
#include<float.h>/* for _isnan */
1817
#include<limits.h>
1918
#include<math.h>
2019

‎src/backend/utils/adt/nabstime.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include"postgres.h"
1818

1919
#include<ctype.h>
20-
#include<float.h>
2120
#include<limits.h>
2221
#include<math.h>
2322
#include<time.h>

‎src/backend/utils/adt/orderedsetaggs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*/
1515
#include"postgres.h"
1616

17-
#include<float.h>
1817
#include<math.h>
1918

2019
#include"catalog/pg_aggregate.h"

‎src/backend/utils/adt/selfuncs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
#include"postgres.h"
9999

100100
#include<ctype.h>
101-
#include<float.h>
102101
#include<math.h>
103102

104103
#include"access/brin.h"

‎src/backend/utils/adt/timestamp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include<ctype.h>
1919
#include<math.h>
20-
#include<float.h>
2120
#include<limits.h>
2221
#include<sys/time.h>
2322

‎src/backend/utils/misc/help_config.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
#include"postgres.h"
1818

19-
#include<float.h>
2019
#include<limits.h>
2120
#include<unistd.h>
2221

‎src/include/port/win32_port.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,14 @@ typedef unsigned short mode_t;
502502
#defineW_OK 2
503503
#defineR_OK 4
504504

505+
/*
506+
* isinf() and isnan() should per spec be in <math.h>, but MSVC older than
507+
* 2013 does not have them there. It does have _fpclass() and _isnan(), but
508+
* they're in <float.h>, so include that here even though it means float.h
509+
* percolates to our whole tree. Recent versions don't require any of this.
510+
*/
505511
#if (_MSC_VER<1800)
512+
#include<float.h>
506513
#defineisinf(x) ((_fpclass(x) == _FPCLASS_PINF) || (_fpclass(x) == _FPCLASS_NINF))
507514
#defineisnan(x) _isnan(x)
508515
#endif

‎src/interfaces/ecpg/ecpglib/data.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#definePOSTGRES_ECPG_INTERNAL
44
#include"postgres_fe.h"
55

6-
#include<float.h>
76
#include<math.h>
87

98
#include"ecpgtype.h"

‎src/interfaces/ecpg/ecpglib/execute.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#definePOSTGRES_ECPG_INTERNAL
1717
#include"postgres_fe.h"
1818

19-
#include<float.h>
2019
#include<math.h>
2120

2221
#include"catalog/pg_type_d.h"

‎src/interfaces/ecpg/pgtypeslib/datetime.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#include<time.h>
66
#include<ctype.h>
7-
#include<float.h>
87
#include<limits.h>
98

109
#include"extern.h"

‎src/interfaces/ecpg/pgtypeslib/timestamp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include"postgres_fe.h"
55

66
#include<time.h>
7-
#include<float.h>
87
#include<limits.h>
98
#include<math.h>
109

‎src/port/rint.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313
#include"c.h"
1414

15-
#include<float.h>
1615
#include<math.h>
1716

1817
/*

‎src/port/snprintf.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
#include"c.h"
3434

3535
#include<ctype.h>
36-
#ifdef_MSC_VER
37-
#include<float.h>/* for _isnan */
38-
#endif
3936
#include<limits.h>
4037
#include<math.h>
4138
#ifndefWIN32

‎src/test/regress/regress.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include"postgres.h"
1818

19-
#include<float.h>
2019
#include<math.h>
2120
#include<signal.h>
2221

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp