GraphicsMagick: Provide hotfix for older MSVCs that does not hav...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.35911.1671996435.1459.graphicsmagick-commit@lists.sourceforge.net>
changeset 663bf988be8c in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=663bf988be8c
summary: Provide hotfix for older MSVCs that does not have stdbool.h.

diffstat:

 jp2/src/libjasper/base/jas_image.c           |    2 +-
 jp2/src/libjasper/base/jas_malloc.c          |    2 +-
 jp2/src/libjasper/base/jas_version.c         |  140 +++++++++++++-------------
 jp2/src/libjasper/include/jasper/jas_image.h |    2 +-
 jp2/src/libjasper/include/jasper/jas_math.h  |    2 +-
 jp2/src/libjasper/include/jasper/stdbool2.h  |   14 ++
 tiff/libtiff/stdbool2.h                      |   14 ++
 tiff/libtiff/tif_hash_set.c                  |    2 +-
 tiff/libtiff/tif_hash_set.h                  |    2 +-
 tiff/libtiff/tif_lzw.c                       |    2 +-
 tiff/libtiff/tif_webp.c                      |    2 +-
 tiff/test/custom_dir_EXIF_231.c              |    2 +-
 tiff/test/test_directory.c                   |    2 +-
 13 files changed, 108 insertions(+), 80 deletions(-)

diffs (309 lines):

diff -r f5025507c011 -r 663bf988be8c jp2/src/libjasper/base/jas_image.c
--- a/jp2/src/libjasper/base/jas_image.c	Sun Dec 25 18:37:17 2022 +0100
+++ b/jp2/src/libjasper/base/jas_image.c	Sun Dec 25 20:26:33 2022 +0100
@@ -77,7 +77,7 @@
 #include <assert.h>
 #include <ctype.h>
 //#include <inttypes.h>
-#include <stdbool.h>
+#include "stdbool2.h"
 #include <limits.h>
 
 #include "jasper/jas_math.h"
diff -r f5025507c011 -r 663bf988be8c jp2/src/libjasper/base/jas_malloc.c
--- a/jp2/src/libjasper/base/jas_malloc.c	Sun Dec 25 18:37:17 2022 +0100
+++ b/jp2/src/libjasper/base/jas_malloc.c	Sun Dec 25 20:26:33 2022 +0100
@@ -74,7 +74,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 //#include <stdint.h>
-#include <stdbool.h>
+#include "stdbool2.h"
 #include <stddef.h>
 #include <assert.h>
 
diff -r f5025507c011 -r 663bf988be8c jp2/src/libjasper/base/jas_version.c
--- a/jp2/src/libjasper/base/jas_version.c	Sun Dec 25 18:37:17 2022 +0100
+++ b/jp2/src/libjasper/base/jas_version.c	Sun Dec 25 20:26:33 2022 +0100
@@ -1,72 +1,72 @@
-/*
- * Copyright (c) 2001-2002 Michael David Adams.
- * All rights reserved.
- */
-
-/* __START_OF_JASPER_LICENSE__
- * 
- * JasPer License Version 2.0
- * 
- * Copyright (c) 2001-2006 Michael David Adams
- * Copyright (c) 1999-2000 Image Power, Inc.
- * Copyright (c) 1999-2000 The University of British Columbia
- * 
- * All rights reserved.
- * 
- * Permission is hereby granted, free of charge, to any person (the
- * "User") obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the
- * following conditions:
- * 
- * 1.  The above copyright notices and this permission notice (which
- * includes the disclaimer below) shall be included in all copies or
- * substantial portions of the Software.
- * 
- * 2.  The name of a copyright holder shall not be used to endorse or
- * promote products derived from the Software without specific prior
- * written permission.
- * 
- * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
- * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
- * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
- * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
- * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
- * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
- * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
- * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
- * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
- * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
- * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
- * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
- * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
- * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
- * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
- * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
- * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
- * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
- * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
- * 
- * __END_OF_JASPER_LICENSE__
- */
-
-#include "jasper/jas_version.h"
-
-const char *jas_getversion()
-{
-	return JAS_VERSION;
-}
-
-
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#include "jasper/jas_version.h"
+
+const char *jas_getversion()
+{
+	return JAS_VERSION;
+}
+
+
 #ifdef _MSC_VER			/* Fix provided by J.Fojtik */
 #if _MSC_VER < 1800
   unsigned long long __cdecl strtoull (
@@ -78,4 +78,4 @@
     return _strtoui64(nptr, endptr, ibase);
 }
 #endif
-#endif
+#endif
diff -r f5025507c011 -r 663bf988be8c jp2/src/libjasper/include/jasper/jas_image.h
--- a/jp2/src/libjasper/include/jasper/jas_image.h	Sun Dec 25 18:37:17 2022 +0100
+++ b/jp2/src/libjasper/include/jasper/jas_image.h	Sun Dec 25 20:26:33 2022 +0100
@@ -81,7 +81,7 @@
 #include <jasper/jas_seq.h>
 #include <jasper/jas_cm.h>
 #include <stdio.h>
-#include <stdbool.h>
+#include "stdbool2.h"
 
 #ifdef __cplusplus
 extern "C" {
diff -r f5025507c011 -r 663bf988be8c jp2/src/libjasper/include/jasper/jas_math.h
--- a/jp2/src/libjasper/include/jasper/jas_math.h	Sun Dec 25 18:37:17 2022 +0100
+++ b/jp2/src/libjasper/include/jasper/jas_math.h	Sun Dec 25 20:26:33 2022 +0100
@@ -82,7 +82,7 @@
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdbool.h>
+#include "stdbool2.h"
 #include <stdint.h>
 
 #ifdef __cplusplus
diff -r f5025507c011 -r 663bf988be8c jp2/src/libjasper/include/jasper/stdbool2.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jp2/src/libjasper/include/jasper/stdbool2.h	Sun Dec 25 20:26:33 2022 +0100
@@ -0,0 +1,14 @@
+#ifndef __STDBOOL2_H__
+#define __STDBOOL2_H__
+
+
+#if defined(_MSC_VER) && _MSC_VER < 1500
+ #ifndef __cplusplus
+  #define bool int
+ #endif
+#else
+ #include <stdbool.h>
+#endif
+
+
+#endif
\ No newline at end of file
diff -r f5025507c011 -r 663bf988be8c tiff/libtiff/stdbool2.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tiff/libtiff/stdbool2.h	Sun Dec 25 20:26:33 2022 +0100
@@ -0,0 +1,14 @@
+#ifndef __STDBOOL2_H__
+#define __STDBOOL2_H__
+
+
+#if defined(_MSC_VER) && _MSC_VER < 1500
+ #ifndef __cplusplus
+  #define bool int
+ #endif
+#else
+ #include <stdbool.h>
+#endif
+
+
+#endif
\ No newline at end of file
diff -r f5025507c011 -r 663bf988be8c tiff/libtiff/tif_hash_set.c
--- a/tiff/libtiff/tif_hash_set.c	Sun Dec 25 18:37:17 2022 +0100
+++ b/tiff/libtiff/tif_hash_set.c	Sun Dec 25 20:26:33 2022 +0100
@@ -29,7 +29,7 @@
 #include "tif_hash_set.h"
 
 #include <assert.h>
-#include <stdbool.h>
+#include "stdbool2.h"
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -r f5025507c011 -r 663bf988be8c tiff/libtiff/tif_hash_set.h
--- a/tiff/libtiff/tif_hash_set.h	Sun Dec 25 18:37:17 2022 +0100
+++ b/tiff/libtiff/tif_hash_set.h	Sun Dec 25 20:26:33 2022 +0100
@@ -31,7 +31,7 @@
 #ifndef TIFF_HASH_SET_H_INCLUDED
 #define TIFF_HASH_SET_H_INCLUDED
 
-#include <stdbool.h>
+#include "stdbool2.h"
 
 /**
  * \file tif_hash_set.h
diff -r f5025507c011 -r 663bf988be8c tiff/libtiff/tif_lzw.c
--- a/tiff/libtiff/tif_lzw.c	Sun Dec 25 18:37:17 2022 +0100
+++ b/tiff/libtiff/tif_lzw.c	Sun Dec 25 20:26:33 2022 +0100
@@ -37,7 +37,7 @@
  */
 #include "tif_predict.h"
 
-#include <stdbool.h>
+#include "stdbool2.h"
 #include <stdio.h>
 #include <stdlib.h>
 
diff -r f5025507c011 -r 663bf988be8c tiff/libtiff/tif_webp.c
--- a/tiff/libtiff/tif_webp.c	Sun Dec 25 18:37:17 2022 +0100
+++ b/tiff/libtiff/tif_webp.c	Sun Dec 25 20:26:33 2022 +0100
@@ -34,7 +34,7 @@
 #include "webp/decode.h"
 #include "webp/encode.h"
 
-#include <stdbool.h>
+#include "stdbool2.h"
 #include <stdio.h>
 
 #define LSTATE_INIT_DECODE 0x01
diff -r f5025507c011 -r 663bf988be8c tiff/test/custom_dir_EXIF_231.c
--- a/tiff/test/custom_dir_EXIF_231.c	Sun Dec 25 18:37:17 2022 +0100
+++ b/tiff/test/custom_dir_EXIF_231.c	Sun Dec 25 20:26:33 2022 +0100
@@ -70,7 +70,7 @@
 
 #include <errno.h>
 #include <math.h>
-#include <stdbool.h>
+#include "stdbool2.h"
 #include <stdio.h>
 #include <string.h>
 
diff -r f5025507c011 -r 663bf988be8c tiff/test/test_directory.c
--- a/tiff/test/test_directory.c	Sun Dec 25 18:37:17 2022 +0100
+++ b/tiff/test/test_directory.c	Sun Dec 25 20:26:33 2022 +0100
@@ -27,7 +27,7 @@
 
 #include "tif_config.h"
 
-#include <stdbool.h>
+#include "stdbool2.h"
 #include <stdio.h>
 
 #include "tiffio.h"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.