annotate src/dcmtk-2-mingw-w64.patch @ 7207:9ed6500e56d3 default tip @

maint: Merge release to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 17 May 2024 20:16:41 +0200
parents fb000475ca16
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5066
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
1 This file is part of MXE. See LICENSE.md for licensing information.
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
2
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
3 From 2d08af9a15089c354b436282e4d23f462a81ce8f Mon Sep 17 00:00:00 2001
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
4 From: MXE <mxe@mxe.cc>
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
5 Date: Tue, 7 Oct 2014 21:50:59 -0700
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
6 Subject: [PATCH] Fix i686-w64-mingw32
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
7
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
8 Cherry-picked from
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
9 http://git.dcmtk.org/web?p=dcmtk.git;a=commitdiff;h=b8a53c5f7fd12e9479f830680ef84f93805fd004
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
10
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
11 diff --git a/config/configure.in b/config/configure.in
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
12 index e343ce1..a305114 100644
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
13 --- a/config/configure.in
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
14 +++ b/config/configure.in
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
15 @@ -199,6 +199,10 @@ AC_CHECK_TYPES(longlong)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
16 AC_CHECK_TYPES(ulonglong)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
17 CHECK_VLA
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
18
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
19 +dnl File access stuff
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
20 +AC_CHECK_TYPES(fpos64_t)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
21 +AC_CHECK_TYPES(off64_t)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
22 +
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
23 dnl stdbool.h and stdint.h are only defined in ANSI C, not in C++
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
24 AC_CHECK_HEADERS(stdbool.h)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
25 AC_CHECK_HEADERS(stdint.h)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
26 @@ -232,6 +236,7 @@ AC_CHECK_FUNCS(sleep fork)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
27 AC_CHECK_FUNCS(_findfirst)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
28 AC_CHECK_FUNCS(strlcpy strlcat)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
29 AC_CHECK_FUNCS(vsnprintf)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
30 +AC_CHECK_FUNCS(popen pclose)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
31 AC_FUNC_FSEEKO
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
32
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
33
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
34 diff --git a/config/include/dcmtk/config/cfunix.h.in b/config/include/dcmtk/config/cfunix.h.in
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
35 index 3a6cd69..ed211ca 100644
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
36 --- a/config/include/dcmtk/config/cfunix.h.in
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
37 +++ b/config/include/dcmtk/config/cfunix.h.in
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
38 @@ -157,6 +157,9 @@
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
39 /* Define to 1 if you have the `fork' function. */
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
40 #undef HAVE_FORK
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
41
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
42 +/* Define to 1 if the system has the type `fpos64_t'. */
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
43 +#undef HAVE_FPOS64_T
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
44 +
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
45 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
46 #undef HAVE_FSEEKO
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
47
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
48 @@ -424,14 +427,23 @@ typedef unsigned short ushort;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
49 /* Define to 1 if you have the `ntohs' function. */
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
50 #undef HAVE_NTOHS
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
51
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
52 +/* Define to 1 if the system has the type `off64_t'. */
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
53 +#undef HAVE_OFF64_T
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
54 +
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
55 /* Define if your system supports readdir_r with the obsolete Posix 1.c draft
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
56 6 declaration (2 arguments) instead of the Posix 1.c declaration with 3
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
57 arguments. */
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
58 #undef HAVE_OLD_READDIR_R
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
59
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
60 +/* Define to 1 if you have the `pclose' function. */
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
61 +#undef HAVE_PCLOSE
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
62 +
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
63 /* Define if pthread_t is a pointer type on your system */
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
64 #undef HAVE_POINTER_TYPE_PTHREAD_T
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
65
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
66 +/* Define to 1 if you have the `popen' function. */
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
67 +#undef HAVE_POPEN
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
68 +
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
69 /* Define if your system has a prototype for accept in sys/types.h
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
70 sys/socket.h */
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
71 #undef HAVE_PROTOTYPE_ACCEPT
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
72 diff --git a/ofstd/include/dcmtk/ofstd/offile.h b/ofstd/include/dcmtk/ofstd/offile.h
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
73 index 0f5d454..3f5a677 100644
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
74 --- a/ofstd/include/dcmtk/ofstd/offile.h
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
75 +++ b/ofstd/include/dcmtk/ofstd/offile.h
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
76 @@ -75,26 +75,36 @@ END_EXTERN_C
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
77 #endif
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
78 #endif
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
79
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
80 -#if defined(_WIN32) && !defined(__MINGW32__)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
81 - // On Win32 systems except MinGW (where Posix definitions are available)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
82 - // we use Win32 specific definitions
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
83 - typedef __int64 offile_off_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
84 - typedef fpos_t offile_fpos_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
85 +// Explicit LFS (LFS64) and Windows need 64 bit types
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
86 +#if defined(EXPLICIT_LFS_64) || defined(_WIN32)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
87 +
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
88 +// Use POSIX 64 bit file position type when available
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
89 +#ifdef HAVE_FPOS64_T
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
90 +typedef fpos64_t offile_fpos_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
91 +#else // Otherwise this should be sufficient
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
92 +typedef fpos_t offile_fpos_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
93 +#endif
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
94 +
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
95 +// Use POSIX 64 bit file offset type when available
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
96 +#ifdef HAVE_OFF64_T
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
97 +typedef off64_t offile_off_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
98 +#elif !defined(OF_NO_SINT64) // Otherwise use a 64 bit integer
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
99 +typedef Sint64 offile_off_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
100 +#else // Cry when 64 LFS is required but no 64 bit integer exists
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
101 +#error \
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
102 + Could not find a suitable offset-type for LFS64 support.
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
103 +#endif
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
104 +
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
105 +#else // Implicit LFS or no LFS
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
106 +
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
107 +#ifdef HAVE_FSEEKO
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
108 +typedef off_t offile_off_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
109 #else
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
110 - #ifdef EXPLICIT_LFS_64
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
111 - // Explicit LFS (LFS64)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
112 - typedef fpos64_t offile_fpos_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
113 - typedef off64_t offile_off_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
114 - #else
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
115 - // Implicit LFS or no LFS
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
116 - #ifdef HAVE_FSEEKO
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
117 - typedef off_t offile_off_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
118 - #else
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
119 - typedef long offile_off_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
120 - #endif
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
121 - typedef fpos_t offile_fpos_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
122 - #endif
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
123 +typedef long offile_off_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
124 #endif
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
125 +typedef fpos_t offile_fpos_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
126 +
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
127 +#endif // basic type definitions
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
128
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
129 // the type we use to store the last error.
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
130 typedef int offile_errno_t;
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
131 @@ -196,10 +206,10 @@ public:
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
132 OFBool popen(const char *command, const char *modes)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
133 {
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
134 if (file_) fclose();
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
135 -#ifdef _WIN32
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
136 - file_ = _popen(command, modes);
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
137 -#else
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
138 +#ifdef HAVE_POPEN
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
139 file_ = :: popen(command, modes);
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
140 +#else
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
141 + file_ = _popen(command, modes);
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
142 #endif
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
143 if (file_) popened_ = OFTrue; else storeLastError();
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
144 return (file_ != NULL);
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
145 @@ -258,10 +268,10 @@ public:
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
146 {
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
147 if (popened_)
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
148 {
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
149 -#ifdef _WIN32
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
150 - result = _pclose(file_);
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
151 -#else
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
152 +#ifdef HAVE_PCLOSE
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
153 result = :: pclose(file_);
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
154 +#else
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
155 + result = _pclose(file_);
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
156 #endif
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
157 }
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
158 else
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
159 --
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
160 1.8.3.2
fb000475ca16 dcmtk: update patches/build
John Donoghue
parents:
diff changeset
161