Skip to content

Commit f89f115

Browse files
authored
Merge pull request #46 from bgilbert/windows
Windows build fixes
2 parents 70fd24b + 23f1852 commit f89f115

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

include/dicom/dicom.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ typedef SSIZE_T ssize_t;
1313
#endif
1414

1515
#ifdef _WIN32
16-
#ifdef BUILDING_LIBDICOM
16+
#if DCM_STATIC
17+
#define DCM_EXTERN extern
18+
#elif defined(BUILDING_LIBDICOM)
1719
#define DCM_EXTERN __declspec(dllexport) extern
1820
#else
1921
#define DCM_EXTERN __declspec(dllimport) extern

include/dicom/version.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
#define DCM_ABI_VERSION_MINOR (@DCM_ABI_VERSION_MINOR@)
1616
#define DCM_ABI_VERSION_PATCH (@DCM_ABI_VERSION_PATCH@)
1717

18+
/* Whether libdicom is built statically.
19+
*/
20+
#define DCM_STATIC (@DCM_STATIC@)
21+
1822
#endif /*DCM_VERSION_H*/
1923

2024

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ version_data.set('DCM_VERSION_MICRO', version_patch)
5757
version_data.set('DCM_ABI_VERSION_MAJOR', abi_version_major)
5858
version_data.set('DCM_ABI_VERSION_MINOR', abi_version_minor)
5959
version_data.set('DCM_ABI_VERSION_PATCH', abi_version_patch)
60+
version_data.set10('DCM_STATIC', get_option('default_library') == 'static')
6061

6162
# dependencies
6263
cc = meson.get_compiler('c')

src/dicom-io.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define _CRT_NONSTDC_NO_DEPRECATE
1111
// and deprecates strdup
1212
#define strdup(v) _strdup(v)
13+
#include <share.h>
1314
#endif
1415

1516
#include <assert.h>

0 commit comments

Comments
 (0)