From 3db18aa9fef6a32786e4aa0479ed99861fc8d0ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hubert=20Figui=C3=A8re?= <hub@figuiere.net>
Date: Sat, 16 Jun 2018 00:16:45 -0400
Subject: Issue #15 - Ensure all function prototypes are available

- This should fix strdup() return garbage when sizeof(void*) > 4

https://github.com/hfiguiere/exifprobe/issues/15
---
 ciff.c     | 2 ++
 jp2000.c   | 2 ++
 misc.c     | 2 ++
 options.c  | 2 ++
 print.c    | 2 ++
 readfile.c | 1 +
 tagnames.c | 2 ++
 7 files changed, 13 insertions(+)

diff --git a/ciff.c b/ciff.c
index 3b11940..f9fcec9 100644
--- a/ciff.c
+++ b/ciff.c
@@ -21,6 +21,8 @@ static char *ModuleId = "@(#) $Id: ciff.c,v 1.8 2005/07/24 17:03:18 alex Exp $";
 /*    http://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html     */
 /* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */
 
+#define _POSIX_C_SOURCE 200809L /* for strdup() */
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
diff --git a/jp2000.c b/jp2000.c
index 1f031b3..5406665 100644
--- a/jp2000.c
+++ b/jp2000.c
@@ -26,6 +26,8 @@ static char *ModuleId = "@(#) $Id: jp2000.c,v 1.10 2005/07/24 19:54:04 alex Exp
 /* 64-bit addressing is not yet supported                             */
 /* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */
 
+#define _DEFAULT_SOURCE /* for isacii() */
+
 #include <stdio.h>
 #include <string.h>
 #include <time.h>
diff --git a/misc.c b/misc.c
index 455cc00..e8e2343 100644
--- a/misc.c
+++ b/misc.c
@@ -10,6 +10,8 @@
 static char *ModuleId = "@(#) $Id: misc.c,v 1.22 2005/07/24 16:01:17 alex Exp $";
 #endif
 
+#define _POSIX_C_SOURCE 200809L /* for strdup() */
+
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
diff --git a/options.c b/options.c
index 740f275..8217808 100644
--- a/options.c
+++ b/options.c
@@ -10,6 +10,8 @@
 static char *ModuleId = "@(#) $Id: options.c,v 1.21 2005/07/24 17:18:27 alex Exp $";
 #endif
 
+#define _POSIX_C_SOURCE 1 /* for fileno() */
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/print.c b/print.c
index 0b0b8ed..208a1cb 100644
--- a/print.c
+++ b/print.c
@@ -13,6 +13,8 @@ static char *ModuleId = "@(#) $Id: print.c,v 1.51 2005/07/24 17:16:59 alex Exp $
 /* This file contains the primary "print" routines for TIFF/EXIF      */
 /* data, file offsets, etc.                                           */
 
+#define _DEFAULT_SOURCE /* for isacii() */
+
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
diff --git a/readfile.c b/readfile.c
index 0761308..012f412 100644
--- a/readfile.c
+++ b/readfile.c
@@ -21,6 +21,7 @@ static char *ModuleId = "@(#) $Id: readfile.c,v 1.30 2005/07/24 18:15:28 alex Ex
 /* byteorder is "little-endian". The code does not currently handle   */
 /* "pdp11" byteorder.                                                 */
 
+#define _DEFAULT_SOURCE /* for isacii() */
 
 #include <stdio.h>
 #include <stdint.h>
diff --git a/tagnames.c b/tagnames.c
index 781545a..19dc462 100644
--- a/tagnames.c
+++ b/tagnames.c
@@ -10,6 +10,8 @@
 static char *ModuleId = "@(#) $Id: tagnames.c,v 1.21 2005/07/24 19:40:09 alex Exp $";
 #endif
 
+#define _POSIX_C_SOURCE 200809L /* for strdup() */
+
 #include <stdio.h>
 #include <string.h>
 #include "defs.h"
-- 
2.11.0

