shithub: jbig2

Download patch

ref: c5bd9271ff22faa44bfe4d0120562c52fa964237
parent: 9d23c17acdea2efdbed778078e377c3325106de2
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Wed Sep 3 03:27:00 EDT 2003

Add some uint*_t typedefs for cygwin. Cygwin apparently doesn't provide stdint.h, but does define
some of the types in sys/types.h which conflict with the versions in config_types.h. We only use
sys/types.h in snprintf.c, but it's pulled in by Ghostscript's portability cruft when we're
compiling in rather than linking to that program. Thus we must circumvent the config_types.h
definitions on that platfrom.

After a patch by Alex Cherepanov.


git-svn-id: http://svn.ghostscript.com/jbig2dec/trunk@273 ded80894-8fb9-0310-811b-c03f3676ab4d

--- a/os_types.h
+++ b/os_types.h
@@ -27,16 +27,25 @@
 #ifndef _JBIG2_OS_TYPES_H
 #define _JBIG2_OS_TYPES_H
 
-#ifdef HAVE_CONFIG_H
-#include "config_types.h"
+#ifdef __CYGWIN__
+# include <sys/types.h>
+  /*
+   * Cygwin has no stdint.h but defines "MS types". Some of them conflict with
+   * a standard type emulation provided by config_types.h .
+   */
+   typedef u_int8_t uint8_t;
+   typedef u_int16_t uint16_t;
+   typedef u_int32_t uint32_t;
+#elif HAVE_CONFIG_H
+# include "config_types.h"
 #elif defined(_WIN32)
-#include "config_win32.h"
+# include "config_win32.h"
 #endif
 
 #if defined(HAVE_STDINT_H) || defined(__MACOS__)
-#include <stdint.h>
+# include <stdint.h>
 #elif defined(__VMS)
-#include <inttypes.h>
+# include <inttypes.h>
 #endif
 
 #endif /* _JBIG2_OS_TYPES_H */