about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--analyzer/pamtilt.c2
-rw-r--r--converter/other/cameratopam/foveon.c2
-rw-r--r--converter/other/pamtosvg/vector.c2
-rw-r--r--converter/ppm/ppmtompeg/jrevdct.c2
-rw-r--r--converter/ppm/ppmtompeg/mfwddct.c2
-rw-r--r--doc/HISTORY7
-rw-r--r--editor/pamaddnoise.c2
-rw-r--r--editor/pamscale.c2
-rw-r--r--editor/pnmrotate.c2
-rw-r--r--editor/pnmshear.c2
-rw-r--r--editor/ppmlabel.c2
-rw-r--r--editor/specialty/pnmmercator.c2
-rw-r--r--editor/specialty/ppmglobe.c2
-rw-r--r--generator/pamcrater.c2
-rw-r--r--generator/pamshadedrelief.c2
-rw-r--r--generator/ppmforge.c2
16 files changed, 22 insertions, 15 deletions
diff --git a/analyzer/pamtilt.c b/analyzer/pamtilt.c
index 302c6247..70338545 100644
--- a/analyzer/pamtilt.c
+++ b/analyzer/pamtilt.c
@@ -10,7 +10,7 @@
   All work has been contributed to the public domain by its authors.
 =============================================================================*/
 
-#define _XOPEN_SOURCE   /* get M_PI in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <assert.h>
 #include <math.h>
diff --git a/converter/other/cameratopam/foveon.c b/converter/other/cameratopam/foveon.c
index a3e5449a..992f3883 100644
--- a/converter/other/cameratopam/foveon.c
+++ b/converter/other/cameratopam/foveon.c
@@ -1,6 +1,6 @@
 /* This code is licensed to the public by its copyright owners under GPL. */
 
-#define _XOPEN_SOURCE   /* get M_PI */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <stdio.h>
 #include <assert.h>
diff --git a/converter/other/pamtosvg/vector.c b/converter/other/pamtosvg/vector.c
index 0a5ef3a9..771e5f27 100644
--- a/converter/other/pamtosvg/vector.c
+++ b/converter/other/pamtosvg/vector.c
@@ -1,6 +1,6 @@
 /* vector.c: vector/point operations. */
 
-#define _XOPEN_SOURCE   /* Make sure M_PI is in <math.h> */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 #include <math.h>
 #include <errno.h>
 #include <assert.h>
diff --git a/converter/ppm/ppmtompeg/jrevdct.c b/converter/ppm/ppmtompeg/jrevdct.c
index f7b32192..dd1f9fff 100644
--- a/converter/ppm/ppmtompeg/jrevdct.c
+++ b/converter/ppm/ppmtompeg/jrevdct.c
@@ -26,7 +26,7 @@
  * matrix, perhaps with the difference cases encoded.
  */
 
-#define _XOPEN_SOURCE  /* Make sure M_PI is in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <memory.h>
 #include <math.h>
diff --git a/converter/ppm/ppmtompeg/mfwddct.c b/converter/ppm/ppmtompeg/mfwddct.c
index ce85436d..9381e51c 100644
--- a/converter/ppm/ppmtompeg/mfwddct.c
+++ b/converter/ppm/ppmtompeg/mfwddct.c
@@ -15,7 +15,7 @@
  * instead of floating point.
  */
 
-#define _XOPEN_SOURCE  /* Make sure M_PI is in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <math.h>
 
diff --git a/doc/HISTORY b/doc/HISTORY
index 513f6518..82622a16 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -42,6 +42,13 @@ not yet  BJH  Release 10.79.00
               exists (so don't require ppmdcfont to exist).  Broken around
               Netpbm 10.35 (2006).
 
+              Build: Define _XOPEN_SOURCE=500 in source files that use M_PI.
+              While C libraries in the past have always provided this with
+              just _XOPEN_SOURCE=null, it appears that M_PI is actually
+              defined by Single Unix Specification 2, aka UNIX98, for which
+              you need _XOPEN_SOURCE=500, and Cygwin has changed to enforce
+              this.
+
               Debian packaging: fix bug: don't try to include Manweb files, as
               it is no longer packaged by 'make package'.
 
diff --git a/editor/pamaddnoise.c b/editor/pamaddnoise.c
index cf1af815..354e0dc4 100644
--- a/editor/pamaddnoise.c
+++ b/editor/pamaddnoise.c
@@ -26,7 +26,7 @@
 ** Prentice Hall, 1993  ISBN 0-13-145814-0
 */
 
-#define _XOPEN_SOURCE   /* get M_PI in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <math.h>
 
diff --git a/editor/pamscale.c b/editor/pamscale.c
index 7c6ee256..0456d15a 100644
--- a/editor/pamscale.c
+++ b/editor/pamscale.c
@@ -22,7 +22,7 @@
    implied warranty.
 */
 
-#define _XOPEN_SOURCE   /* get M_PI in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/editor/pnmrotate.c b/editor/pnmrotate.c
index da5de3a8..44952a59 100644
--- a/editor/pnmrotate.c
+++ b/editor/pnmrotate.c
@@ -10,7 +10,7 @@
 ** implied warranty.
 */
 
-#define _XOPEN_SOURCE   /* get M_PI in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <math.h>
 #include <assert.h>
diff --git a/editor/pnmshear.c b/editor/pnmshear.c
index 99fa3026..1c330bb7 100644
--- a/editor/pnmshear.c
+++ b/editor/pnmshear.c
@@ -10,7 +10,7 @@
 ** implied warranty.
 */
 
-#define _XOPEN_SOURCE   /* get M_PI in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <assert.h>
 #include <math.h>
diff --git a/editor/ppmlabel.c b/editor/ppmlabel.c
index 885d7d36..389ab59e 100644
--- a/editor/ppmlabel.c
+++ b/editor/ppmlabel.c
@@ -7,7 +7,7 @@
                   June 1995
 */
 
-#define _XOPEN_SOURCE   /* get M_PI in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <math.h>
 #include <string.h>
diff --git a/editor/specialty/pnmmercator.c b/editor/specialty/pnmmercator.c
index cd9ff19b..81f7f148 100644
--- a/editor/specialty/pnmmercator.c
+++ b/editor/specialty/pnmmercator.c
@@ -16,7 +16,7 @@
 **
 */
 
-#define _XOPEN_SOURCE  /* Make sure M_PI is in <math.h> */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 #include <math.h>
 #include <string.h>
 
diff --git a/editor/specialty/ppmglobe.c b/editor/specialty/ppmglobe.c
index 92e22746..bb043cc6 100644
--- a/editor/specialty/ppmglobe.c
+++ b/editor/specialty/ppmglobe.c
@@ -9,7 +9,7 @@
  */
 
 
-#define _XOPEN_SOURCE  /* get M_PI in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/generator/pamcrater.c b/generator/pamcrater.c
index 50745501..c0a851ed 100644
--- a/generator/pamcrater.c
+++ b/generator/pamcrater.c
@@ -41,7 +41,7 @@
    right edge. Make craters wrap around the image (enables tiling of image).
  */
 
-#define _XOPEN_SOURCE   /* get M_PI in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <assert.h>
 #include <math.h>
diff --git a/generator/pamshadedrelief.c b/generator/pamshadedrelief.c
index 89996c83..35d1e3e0 100644
--- a/generator/pamshadedrelief.c
+++ b/generator/pamshadedrelief.c
@@ -38,7 +38,7 @@
    edge.
 */
 
-#define _XOPEN_SOURCE   /* get M_PI in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <assert.h>
 #include <math.h>
diff --git a/generator/ppmforge.c b/generator/ppmforge.c
index 8ea86429..390180e3 100644
--- a/generator/ppmforge.c
+++ b/generator/ppmforge.c
@@ -31,7 +31,7 @@
 
 */
 
-#define _XOPEN_SOURCE   /* get M_PI in math.h */
+#define _XOPEN_SOURCE 500  /* get M_PI in math.h */
 
 #include <math.h>
 #include <assert.h>