diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2021-08-05 11:48:10 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2021-08-09 12:42:51 +0200 |
commit | 6de7fee9b74fc0a1c6f45c064ed40474df899efc (patch) | |
tree | ed3953c7553c3014c74951f132e3c7423b6d6450 /jbig2dec | |
parent | 05f8fd8b1958797c1703df6dabb68bba7d143188 (diff) | |
download | ghostpdl-6de7fee9b74fc0a1c6f45c064ed40474df899efc.tar.gz |
jbig2dec: Do not redefine inline until all systemwide headers are included.
When cross-compiling jbig2dec like so:
./configure --host=i686-w64-mingw32 --disable-static && make clean && make
... you get linker errors about multiple definintions of llabs, lltoa, etc.
The reason for this is that the inline keyword has been redfined to the empty
string. After that has been done in jbig2.h it includes jbig2_priv.h which
includes memento.h which includes stdlib.h. The inline redefinition causes
all declarations in stdlib.h to then be done without inline causing the
functions to be present at least twice in in the set of object files.
The redefine was introduced in commit cb456c92a550e1af70a4e268b2f5b02f2df5b8c6
Since jbig2.h is jbig2dec's public header this would affect any program that
includes jbig2.h and then includes system-wide headers after that.
This commit circumvents the issue by moving the inline redefine from the end
of the public jbig2.h header to later in the internal jbig2_priv.h header,
immediately after memento.h has been included. This way the redefine still
affects any jbig2dec internal source code, but not any users of jbig2dec.
Diffstat (limited to 'jbig2dec')
-rw-r--r-- | jbig2dec/jbig2.h | 5 | ||||
-rw-r--r-- | jbig2dec/jbig2_priv.h | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/jbig2dec/jbig2.h b/jbig2dec/jbig2.h index c83517e78..49fb1f024 100644 --- a/jbig2dec/jbig2.h +++ b/jbig2dec/jbig2.h @@ -105,11 +105,6 @@ void jbig2_release_page(Jbig2Ctx *ctx, Jbig2Image *image); /* mark the current page as complete, simulating an end-of-page segment (for broken streams) */ int jbig2_complete_page(Jbig2Ctx *ctx); -/* If we don't have a definition for inline, make it nothing so the code will compile */ -#ifndef inline -#define inline -#endif - #ifdef __cplusplus } #endif diff --git a/jbig2dec/jbig2_priv.h b/jbig2dec/jbig2_priv.h index ac341cdc9..ed366af5c 100644 --- a/jbig2dec/jbig2_priv.h +++ b/jbig2dec/jbig2_priv.h @@ -35,6 +35,11 @@ /* library internals */ +/* If we don't have a definition for inline, make it nothing so the code will compile */ +#ifndef inline +#define inline +#endif + typedef uint8_t byte; #define bool int |