shithub: jbig2

Download patch

ref: e3092e1ff329e834e0e131ada149c692cff01688
parent: 381e60a9cbb6b42136e67e4dd48e67cb438b5a2d
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Fri May 9 09:38:29 EDT 2008

Windows build fixes. Patch from Ghostscript trunk.


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

--- a/config_win32.h
+++ b/config_win32.h
@@ -22,8 +22,8 @@
 #define PACKAGE "jbig2dec"
 #define VERSION "0.3"
 
-#ifdef _MSC_VER /* Microsoft Visual C+*/
-
+#if defined(_MSC_VER) || (defined(__BORLANDC__) && defined(__WIN32__))
+  /* Microsoft Visual C++ or Borland C++ */
   typedef signed char             int8_t;
   typedef short int               int16_t;
   typedef int                     int32_t;
--- a/msvc.mak
+++ b/msvc.mak
@@ -12,7 +12,7 @@
 ZLIBDIR=../zlib
 # define iff you're linking to libpng
 LIBPNG_CFLAGS=-DHAVE_LIBPNG -I$(LIBPNGDIR) -I$(ZLIBDIR)
-LIBPNG_LDFLAGS=$(LIBPNGDIR)/libpng.lib $(ZLIBDIR)/zlib.lib
+LIBPNG_LDFLAGS=$(LIBPNGDIR)/libpng.lib $(ZLIBDIR)/zlib.lib /link /NODEFAULTLIB:LIBCMT
 #LIBPNG_CFLAGS=
 #LIBPNG_LDFLAGS=
 
@@ -19,12 +19,12 @@
 EXE=.exe
 OBJ=.obj
 NUL=
-CFLAGS=-nologo -W4 -Zi -DHAVE_STRING_H=1 $(LIBPNG_CFLAGS)
+CFLAGS=-nologo -W4 -Zi -DHAVE_STRING_H=1 -D_CRT_SECURE_NO_WARNINGS $(LIBPNG_CFLAGS) 
 CC=cl
 FE=-Fe
 
 OBJS=getopt$(OBJ) getopt1$(OBJ) jbig2$(OBJ) jbig2_arith$(OBJ) \
- jbig2_arith_iaid$(OBJ) jbig2_arith_int$(OBJ) jbig2_huffman$(OBJ) \ 
+ jbig2_arith_iaid$(OBJ) jbig2_arith_int$(OBJ) jbig2_huffman$(OBJ) \
  jbig2_generic$(OBJ) jbig2_refinement$(OBJ) \
  jbig2_image$(OBJ) jbig2_image_pbm$(OBJ) jbig2_image_png$(OBJ) \
  jbig2_segment$(OBJ) jbig2_symbol_dict$(OBJ) jbig2_text$(OBJ) \
@@ -39,7 +39,7 @@
 all: jbig2dec$(EXE)
 
 jbig2dec$(EXE): $(OBJS)
-	$(CC) $(CFLAGS) $(FE)jbig2dec$(EXE) $(OBJS) $(LIBPNG_LDFLAGS)
+	$(CC) $(CFLAGS) $(FE)jbig2dec$(EXE) $(OBJS) $(LIBPNG_LDFLAGS) 
 
 getopt$(OBJ): getopt.c getopt.h
 	$(CC) $(CFLAGS) -c getopt.c
--- a/os_types.h
+++ b/os_types.h
@@ -41,7 +41,7 @@
 #endif
 #elif defined(HAVE_CONFIG_H)
 # include "config_types.h"
-#elif defined(_WIN32)
+#elif defined(_WIN32) || defined(__WIN32__) 
 # include "config_win32.h"
 #endif