Discussion:
[gs-bugs] [Bug 698307] - MuPDF - Only older version of Visual Studio don't have stdint.h
b***@artifex.com
2017-07-30 10:23:35 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698307

Bug ID: 698307
Summary: Only older version of Visual Studio don't have
stdint.h
Product: MuPDF
Version: master
Hardware: PC
OS: Windows 7
Status: UNCONFIRMED
Severity: normal
Priority: P4
Component: fitz
Assignee: mupdf-***@artifex.com
Reporter: ***@gmail.com
QA Contact: gs-***@ghostscript.com
Word Size: ---

When building the latest commit (7a0877e9a51fb425389ab2eb3a55ba4036999771)
under MinGW, if I run:
make HAVE_GLFW=no
I get:
[...]
CC build/release/source/fitz/load-jpx.o
In file included from thirdparty/openjpeg/src/lib/openjp2/openjpeg.h:119:0,
from source/fitz/load-jpx.c:454:
thirdparty/openjpeg/src/lib/openjp2/opj_stdint.h:43:27: error: conflicting
types for 'int32_t'
typedef signed __int32 int32_t;
^~~~~~~
In file included from c:\mingw\lib\gcc\mingw32\6.3.0\include\stdint.h:9:0,
from include/mupdf/fitz/system.h:196,
from include/mupdf/fitz.h:10,
from source/fitz/load-jpx.c:1:
c:\mingw\include\stdint.h:62:15: note: previous declaration of 'int32_t'
was here
typedef int int32_t;
^~~~~~~
In file included from thirdparty/openjpeg/src/lib/openjp2/openjpeg.h:119:0,
from source/fitz/load-jpx.c:454:
thirdparty/openjpeg/src/lib/openjp2/opj_stdint.h:44:27: error: conflicting
types for 'uint32_t'
typedef unsigned __int32 uint32_t;
^~~~~~~~
In file included from c:\mingw\lib\gcc\mingw32\6.3.0\include\stdint.h:9:0,
from include/mupdf/fitz/system.h:196,
from include/mupdf/fitz.h:10,
from source/fitz/load-jpx.c:1:
c:\mingw\include\stdint.h:63:19: note: previous declaration of 'uint32_t'
was here
typedef unsigned uint32_t;
^~~~~~~~
make: *** [build/release/source/fitz/load-jpx.o] Error 1
and the build fails.

It seems that line 449 in source/fitz/load-jpx.c assumes that all toolchains
targeting Windows lack the stdint.h include file. This is not true of the MinGW
toolchain. Also, according to https://stackoverflow.com/a/2628014/2910230, and
other places on the internet, it isn't even true of Visual Studio, starting
with VS2010.

If I replace line 449 in source/fitz/load-jpx.c:
#if !defined(_WIN32) && !defined(_WIN64)
with:
#if !defined(_MSC_VER) || _MSC_VER >= 1600
the build succeeds for me under MinGW.
I am also able to build MuPDF, with this change, in VS2013 Express, both for
the Win32 and the x64 targets.
I do not have a pre-2010 version of Visual Studio, to test how this change
would affect those build environments.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-07-30 10:27:00 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698307

Tamir Evan <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-09 15:20:47 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698307

Robin Watts <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@artifex.com
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED

--- Comment #1 from Robin Watts <***@artifex.com> ---
Fixed in:

commit 1970a7eaf29be18e8bf5f32645ac28f7ccc4ad1d (golden/master)
Author: Robin Watts <***@artifex.com>
Date: Thu Nov 9 12:18:25 2017 +0000

Bug 698307: Improve stdint.h detection logic in openjpeg wrapper.

Thanks to Tamir Evan for this tweak.
--
You are receiving this mail because:
You are the QA Contact for the bug.
Loading...