]> git.tdb.fi Git - ext/libjpeg.git/commitdiff
Add MSP build files and some adjustments
authorMikko Rasa <tdb@tdb.fi>
Thu, 7 Sep 2023 16:55:04 +0000 (19:55 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 7 Sep 2023 16:55:04 +0000 (19:55 +0300)
jconfig.h is copied from the jconfig.vc, because that's the platform
I'll mostly use this on, and the definitions seem like a good match for
other modern systems as well.

.gitignore [new file with mode: 0644]
Build [new file with mode: 0644]
jconfig.h [new file with mode: 0644]
jerror.c
jmemmgr.c
jmorecfg.h

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..f6c2a16
--- /dev/null
@@ -0,0 +1,5 @@
+temp/
+/jpeg.dll
+/jpeg.pdb
+/jpeg.lib
+/jpeg_static.lib
diff --git a/Build b/Build
new file mode 100644 (file)
index 0000000..04b0382
--- /dev/null
+++ b/Build
@@ -0,0 +1,73 @@
+package "libjpeg"
+{
+       library "jpeg"
+       {
+               source "jcomapi.c";
+               source "jutils.c";
+               source "jerror.c";
+               source "jmemmgr.c";
+               source "jmemnobs.c";
+               source "jcapimin.c";
+               source "jcapistd.c";
+               source "jctrans.c";
+               source "jcparam.c";
+               source "jdatadst.c";
+               source "jcinit.c";
+               source "jcmaster.c";
+               source "jcmarker.c";
+               source "jcmainct.c";
+               source "jcprepct.c";
+               source "jccoefct.c";
+               source "jccolor.c";
+               source "jcsample.c";
+               source "jchuff.c";
+               source "jcphuff.c";
+               source "jcdctmgr.c";
+               source "jfdctfst.c";
+               source "jfdctflt.c";
+               source "jfdctint.c";
+               source "jdapimin.c";
+               source "jdapistd.c";
+               source "jdtrans.c";
+               source "jdatasrc.c";
+               source "jdmaster.c";
+               source "jdinput.c";
+               source "jdmarker.c";
+               source "jdhuff.c";
+               source "jdphuff.c";
+               source "jdmainct.c";
+               source "jdcoefct.c";
+               source "jdpostct.c";
+               source "jddctmgr.c";
+               source "jidctfst.c";
+               source "jidctflt.c";
+               source "jidctint.c";
+               source "jidctred.c";
+               source "jdsample.c";
+               source "jdcolor.c";
+               source "jquant1.c";
+               source "jquant2.c";
+               source "jdmerge.c";
+               source "jchuff.h";
+               source "jconfig.h";
+               source "jdct.h";
+               source "jdhuff.h";
+               source "jerror.h";
+               source "jinclude.h";
+               source "jmemsys.h";
+               source "jmorecfg.h";
+               source "jpegint.h";
+               source "jpeglib.h";
+               source "jversion.h";
+               install true;
+               install_headers false;
+       };
+
+       install "include"
+       {
+               source "jconfig.h";
+               source "jerror.h";
+               source "jmorecfg.h";
+               source "jpeglib.h";
+       };
+};
diff --git a/jconfig.h b/jconfig.h
new file mode 100644 (file)
index 0000000..7e291c7
--- /dev/null
+++ b/jconfig.h
@@ -0,0 +1,45 @@
+/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
+/* see jconfig.doc for explanations */
+
+#define HAVE_PROTOTYPES
+#define HAVE_UNSIGNED_CHAR
+#define HAVE_UNSIGNED_SHORT
+/* #define void char */
+/* #define const */
+#undef CHAR_IS_UNSIGNED
+#define HAVE_STDDEF_H
+#define HAVE_STDLIB_H
+#undef NEED_BSD_STRINGS
+#undef NEED_SYS_TYPES_H
+#undef NEED_FAR_POINTERS       /* we presume a 32-bit flat memory model */
+#undef NEED_SHORT_EXTERNAL_NAMES
+#undef INCOMPLETE_TYPES_BROKEN
+
+/* Define "boolean" as unsigned char, not int, per Windows custom */
+#ifndef __RPCNDR_H__           /* don't conflict if rpcndr.h already read */
+typedef unsigned char boolean;
+#endif
+#define HAVE_BOOLEAN           /* prevent jmorecfg.h from redefining it */
+
+
+#ifdef JPEG_INTERNALS
+
+#undef RIGHT_SHIFT_IS_UNSIGNED
+
+#endif /* JPEG_INTERNALS */
+
+#ifdef JPEG_CJPEG_DJPEG
+
+#define BMP_SUPPORTED          /* BMP image file format */
+#define GIF_SUPPORTED          /* GIF image file format */
+#define PPM_SUPPORTED          /* PBMPLUS PPM/PGM image file format */
+#undef RLE_SUPPORTED           /* Utah RLE image file format */
+#define TARGA_SUPPORTED                /* Targa image file format */
+
+#define TWO_FILE_COMMANDLINE   /* optional */
+#define USE_SETMODE            /* Microsoft has setmode() */
+#undef NEED_SIGNAL_CATCHER
+#undef DONT_USE_B_MODE
+#undef PROGRESS_REPORT         /* optional */
+
+#endif /* JPEG_CJPEG_DJPEG */
index 3da7be86a00f989d0f7a8094d4619f4d305b6c45..274e8ecc0e271aa711738c9c0e2f646a1ff3c2b9 100644 (file)
--- a/jerror.c
+++ b/jerror.c
@@ -19,6 +19,9 @@
  */
 
 /* this is not a core library module, so it doesn't define JPEG_INTERNALS */
+#ifdef _WIN32
+#define _CRT_SECURE_NO_WARNINGS
+#endif
 #include "jinclude.h"
 #include "jpeglib.h"
 #include "jversion.h"
index d801b322da05e0cd033159ba973676e4305101ef..f196559c7a425b46e2db6fe313be2949e50f426d 100644 (file)
--- a/jmemmgr.c
+++ b/jmemmgr.c
@@ -26,6 +26,9 @@
 
 #define JPEG_INTERNALS
 #define AM_MEMORY_MANAGER      /* we define jvirt_Xarray_control structs */
+#ifdef _WIN32
+#define _CRT_SECURE_NO_WARNINGS
+#endif
 #include "jinclude.h"
 #include "jpeglib.h"
 #include "jmemsys.h"           /* import the system-dependent declarations */
index 54a7d1c447e4ed862caf5a905b0275efcf3629ef..565f13ef3da024c359891f41da6fae924fc198ae 100644 (file)
@@ -180,14 +180,28 @@ typedef unsigned int JDIMENSION;
  * or code profilers that require it.
  */
 
+#if defined(_WIN32)
+#if defined(JPEG_BUILD)
+#define LIBJPEG_API __declspec(dllexport)
+#elif defined(LIBJPEG_IMPORT)
+#define LIBJPEG_API __declspec(dllimport)
+#else
+#define LIBJPEG_API
+#endif
+#elif defined(__GNUC__)
+#define LIBJPEG_API __attribute__((visibility("default")))
+#else
+#define LIBJPEG_API
+#endif
+
 /* a function called through method pointers: */
 #define METHODDEF(type)                static type
 /* a function used only in its module: */
 #define LOCAL(type)            static type
 /* a function referenced thru EXTERNs: */
-#define GLOBAL(type)           type
+#define GLOBAL(type)           LIBJPEG_API type
 /* a reference to a GLOBAL function: */
-#define EXTERN(type)           extern type
+#define EXTERN(type)           LIBJPEG_API extern type
 
 
 /* This macro is used to declare a "method", that is, a function pointer.