about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-08-24 03:10:57 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-08-24 03:10:57 +0000
commit4202f1180bb6951338e094912586c9780ec8b044 (patch)
treef95e66fe88343ff49822dc5ccb2da19fde86a828
parent1758db773edd8b472ca4927930e148a92bbfaca1 (diff)
downloadnetpbm-mirror-4202f1180bb6951338e094912586c9780ec8b044.tar.gz
netpbm-mirror-4202f1180bb6951338e094912586c9780ec8b044.tar.xz
netpbm-mirror-4202f1180bb6951338e094912586c9780ec8b044.zip
Declare _XOPEN_SOURCE >= 500 to make strdup defined
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2257 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/cameratopam/cameratopam.c3
-rw-r--r--converter/other/giftopnm.c1
-rw-r--r--converter/other/ipdb.c1
-rw-r--r--converter/other/pgmtoppm.c1
-rw-r--r--converter/other/svgtopam.c1
-rw-r--r--converter/pbm/pbmtonokia.c1
-rw-r--r--converter/ppm/ppmtompeg/gethostname.c1
-rw-r--r--converter/ppm/ppmtompeg/mpeg.c1
-rw-r--r--converter/ppm/ppmtompeg/ppmtompeg.c1
-rw-r--r--doc/HISTORY3
-rw-r--r--editor/pamperspective.c1
-rw-r--r--editor/pnmmontage.c1
-rw-r--r--editor/ppmcolormask.c1
-rw-r--r--editor/ppmdraw.c5
-rw-r--r--editor/specialty/pnmindex.c1
-rw-r--r--lib/pmfileio.c3
-rw-r--r--lib/util/nstring.c2
-rw-r--r--other/pamx/pamx.c1
-rw-r--r--other/pamx/window.c1
19 files changed, 26 insertions, 4 deletions
diff --git a/converter/other/cameratopam/cameratopam.c b/converter/other/cameratopam/cameratopam.c
index 71c9c7af..0a25686a 100644
--- a/converter/other/cameratopam/cameratopam.c
+++ b/converter/other/cameratopam/cameratopam.c
@@ -8,7 +8,8 @@
 
 
 #define _BSD_SOURCE 1   /* Make sure string.h contains strdup() */
-#define _XOPEN_SOURCE  /* Make sure unistd.h contains swab() */
+#define _XOPEN_SOURCE 500
+   /* Make sure unistd.h contains swab(), string.h constains strdup() */
 
 #include "pm_config.h"
 
diff --git a/converter/other/giftopnm.c b/converter/other/giftopnm.c
index 7d517aad..9a543532 100644
--- a/converter/other/giftopnm.c
+++ b/converter/other/giftopnm.c
@@ -19,6 +19,7 @@
    describe the Lempel-Ziv base.
 */
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* for strcaseeq */
 #include <string.h>
 #include <assert.h>
diff --git a/converter/other/ipdb.c b/converter/other/ipdb.c
index eec4495a..d6bd6ef5 100644
--- a/converter/other/ipdb.c
+++ b/converter/other/ipdb.c
@@ -19,6 +19,7 @@
  *   Authors:  Eric A. Howe (mu@trends.net)
  *             Bryan Henderson, 2010
  */
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Ensure strdup() is in <string.h> */
 #include <assert.h>
 #include <time.h>
diff --git a/converter/other/pgmtoppm.c b/converter/other/pgmtoppm.c
index b556e0d2..f8a69424 100644
--- a/converter/other/pgmtoppm.c
+++ b/converter/other/pgmtoppm.c
@@ -10,6 +10,7 @@
 ** implied warranty.
 */
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in <string.h> */
 #include <string.h>
 
diff --git a/converter/other/svgtopam.c b/converter/other/svgtopam.c
index 26530b9b..137f4732 100644
--- a/converter/other/svgtopam.c
+++ b/converter/other/svgtopam.c
@@ -26,6 +26,7 @@
    
 ============================================================================*/
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in <string.h> */
 #define _POSIX_SOURCE   /* Make sure fileno() is in <stdio.h> */
 #include <assert.h>
diff --git a/converter/pbm/pbmtonokia.c b/converter/pbm/pbmtonokia.c
index 839e6cc1..bf3b9e41 100644
--- a/converter/pbm/pbmtonokia.c
+++ b/converter/pbm/pbmtonokia.c
@@ -4,6 +4,7 @@
    Copyright information is at end of file.
 */
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE    /* Make sure strcaseeq() is in nstring.h */
 #include <string.h>
 #include <assert.h>
diff --git a/converter/ppm/ppmtompeg/gethostname.c b/converter/ppm/ppmtompeg/gethostname.c
index 014b42e8..d20af17c 100644
--- a/converter/ppm/ppmtompeg/gethostname.c
+++ b/converter/ppm/ppmtompeg/gethostname.c
@@ -1,3 +1,4 @@
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Make sure strdup() is in string.h */
 
 #include <string.h>
diff --git a/converter/ppm/ppmtompeg/mpeg.c b/converter/ppm/ppmtompeg/mpeg.c
index 86ce7c7a..5cd7b099 100644
--- a/converter/ppm/ppmtompeg/mpeg.c
+++ b/converter/ppm/ppmtompeg/mpeg.c
@@ -30,6 +30,7 @@
  * HEADER FILES *
  *==============*/
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Make sure strdup() is in string.h */
 
 #include "all.h"
diff --git a/converter/ppm/ppmtompeg/ppmtompeg.c b/converter/ppm/ppmtompeg/ppmtompeg.c
index b8ef37f1..bc788552 100644
--- a/converter/ppm/ppmtompeg/ppmtompeg.c
+++ b/converter/ppm/ppmtompeg/ppmtompeg.c
@@ -30,6 +30,7 @@
  * HEADER FILES *
  *==============*/
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Make sure strdup() is in string.h */
 
 #include <assert.h>
diff --git a/doc/HISTORY b/doc/HISTORY
index d49d140f..ef73b6e4 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -37,6 +37,9 @@ not yet  BJH  Release 10.68.00
               Build: fix build failure on SCO OpenServer due to SIGURG not
               existing.  Broken in Netpbm 10.49 (December 2009).
 
+              Build: Declare _XOPEN_SOURCE >= 500 in source files that use
+              strdup.
+
 14.06.29 BJH  Release 10.67.00
 
               sgitopnm: add ability to convert 2-channel SGI image.
diff --git a/editor/pamperspective.c b/editor/pamperspective.c
index a75e5243..16715c2e 100644
--- a/editor/pamperspective.c
+++ b/editor/pamperspective.c
@@ -18,6 +18,7 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Make sure strdup is int string.h */
 
 #include <assert.h>
diff --git a/editor/pnmmontage.c b/editor/pnmmontage.c
index 47827610..e54afc45 100644
--- a/editor/pnmmontage.c
+++ b/editor/pnmmontage.c
@@ -10,6 +10,7 @@
  * implied warranty.
  */
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in <string.h> */
 #include <assert.h>
 #include <limits.h>
diff --git a/editor/ppmcolormask.c b/editor/ppmcolormask.c
index 4e462f3e..31fbff2a 100644
--- a/editor/ppmcolormask.c
+++ b/editor/ppmcolormask.c
@@ -9,6 +9,7 @@
   Contributed to the public domain by its author.
 =========================================================================*/
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in <string.h> */
 #include <assert.h>
 #include <string.h>
diff --git a/editor/ppmdraw.c b/editor/ppmdraw.c
index c733ffcb..63d781ec 100644
--- a/editor/ppmdraw.c
+++ b/editor/ppmdraw.c
@@ -1,5 +1,6 @@
-#define _XOPEN_SOURCE    /* Make sure M_PI is in math.h */
-#define _BSD_SOURCE      /* Make sure strdup is in string.h */
+#define _XOPEN_SOURCE 500 
+   /* Make sure M_PI is in math.h, strdup is in string.h */
+#define _BSD_SOURCE      /* Make sure strdup is in string.h (alternate) */
 
 #include <string.h>
 #include <ctype.h>
diff --git a/editor/specialty/pnmindex.c b/editor/specialty/pnmindex.c
index 1909c93a..4ec9edaa 100644
--- a/editor/specialty/pnmindex.c
+++ b/editor/specialty/pnmindex.c
@@ -14,6 +14,7 @@
 
 ============================================================================*/
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Make sure strdup is in string.h */
 
 #include <assert.h>
diff --git a/lib/pmfileio.c b/lib/pmfileio.c
index 1263261a..908e793a 100644
--- a/lib/pmfileio.c
+++ b/lib/pmfileio.c
@@ -10,7 +10,8 @@
        does it in other libc's).  pm_config.h defines TMPDIR as P_tmpdir
        in some environments.
     */
-#define _XOPEN_SOURCE 600    /* Make sure ftello, fseeko are defined */
+#define _BSD_SOURCE    /* Make sure strdup is defined */
+#define _XOPEN_SOURCE 600    /* Make sure ftello, fseeko, strdup are defined */
 #define _LARGEFILE_SOURCE 1  /* Make sure ftello, fseeko are defined */
 #define _LARGEFILE64_SOURCE 1 
 #define _FILE_OFFSET_BITS 64
diff --git a/lib/util/nstring.c b/lib/util/nstring.c
index bb2ba92e..1fe66a27 100644
--- a/lib/util/nstring.c
+++ b/lib/util/nstring.c
@@ -113,6 +113,8 @@
  */
 
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
+#define _BSD_SOURCE  /* Make sure strdup() is in string.h */
 #define _GNU_SOURCE
    /* Because of conditional compilation, this is GNU source only if the C
       library is GNU.
diff --git a/other/pamx/pamx.c b/other/pamx/pamx.c
index dbb8b62a..e22693ea 100644
--- a/other/pamx/pamx.c
+++ b/other/pamx/pamx.c
@@ -3,6 +3,7 @@
    Copyright information is in the file COPYRIGHT
 */
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in <string.h> */
 #include <signal.h>
 #include <unistd.h>
diff --git a/other/pamx/window.c b/other/pamx/window.c
index 3cded1b3..e2de1577 100644
--- a/other/pamx/window.c
+++ b/other/pamx/window.c
@@ -6,6 +6,7 @@
    See COPYRIGHT file for copyright information.
 */
 
+#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE    /* Make sure strcaseeq() is in nstring.h */
 
 #include <assert.h>