rev 273 - trunk

[email protected] Wed, 1 Oct 2003 10:36:25 -0700 (PDT)
Newsgroups gmane.comp.printing.ghostscript.jbig2dec.cvs
Message-ID <[email protected]>
Author: giles
Date: 2003-09-03 00:27:00 -0700 (Wed, 03 Sep 2003)
New Revision: 273

Modified:
   trunk/os_types.h
Log:
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.


Modified: trunk/os_types.h
===================================================================
--- trunk/os_types.h	2003-09-03 06:40:03 UTC (rev 272)
+++ trunk/os_types.h	2003-09-03 07:27:00 UTC (rev 273)
@@ -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 */