Skip to content

Commit 3533172

Browse files
Khouri GiordanoNeroBurner
authored andcommitted
export functions for windows dll
1 parent f1df7be commit 3533172

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

jmorecfg.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,11 @@ typedef unsigned int JDIMENSION;
245245
/* a function referenced thru EXTERNs: */
246246
#define GLOBAL(type) type
247247
/* a reference to a GLOBAL function: */
248-
#define EXTERN(type) extern type
248+
#if defined(_WIN32) && defined(JPEG_DLL_EXPORTS)
249+
#define EXTERN(type) extern __declspec(dllexport) type
250+
#else
251+
#define EXTERN(type) extern type
252+
#endif
249253

250254

251255
/* This macro is used to declare a "method", that is, a function pointer.

jpeglib.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,16 @@
2323

2424
#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */
2525
#include "jconfig.h" /* widely used configuration options */
26+
27+
#ifdef HAVE_STDDEF_H
28+
#include <stddef.h> // size_t
2629
#endif
27-
#include "jmorecfg.h" /* seldom changed options */
2830

31+
#include <stdio.h> // FILE
32+
33+
#endif
34+
35+
#include "jmorecfg.h" /* seldom changed options */
2936

3037
#ifdef __cplusplus
3138
#ifndef DONT_USE_EXTERN_C
@@ -883,7 +890,7 @@ typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
883890
/* Short forms of external names for systems with brain-damaged linkers.
884891
* We shorten external names to be unique in the first six letters, which
885892
* is good enough for all known systems.
886-
* (If your compiler itself needs names to be unique in less than 15
893+
* (If your compiler itself needs names to be unique in less than 15
887894
* characters, you are out of luck. Get a better compiler.)
888895
*/
889896

0 commit comments

Comments
 (0)