Skip to content

Commit 5a2afa3

Browse files
committed
fix: correctly define exported attributes in MSYS2
gcc 15 in mingw64 changed some things, and now we need more define cheks, to correctly link the library with MSYS2
1 parent 5646370 commit 5a2afa3

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/helper/windows.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#pragma once
22

3-
#if defined(_MSC_VER)
3+
#if defined(_MSC_VER) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
44
#if defined(OOPETRIS_LIBRARY_GRAPHICS_TYPE) && OOPETRIS_LIBRARY_GRAPHICS_TYPE == 0
55
#if defined(OOPETRIS_LIBRARY_GRAPHICS_EXPORT)
66
#define OOPETRIS_GRAPHICS_EXPORTED __declspec(dllexport)
77
#else
88
#define OOPETRIS_GRAPHICS_EXPORTED __declspec(dllimport)
99
#endif
1010
#else
11-
#define OOPETRIS_GRAPHICS_EXPORTED
11+
#define OOPETRIS_GRAPHICS_EXPORTED __attribute__((visibility("default")))
1212
#endif
1313
#else
1414
#define OOPETRIS_GRAPHICS_EXPORTED

src/libs/core/hash-library/sha256.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <string>
1313

1414
// define fixed size integer types
15-
#ifdef _MSC_VER
15+
#if defined(_MSC_VER) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
1616
// Windows
1717
typedef unsigned __int8 uint8_t;
1818
typedef unsigned __int32 uint32_t;
@@ -25,7 +25,7 @@ typedef unsigned __int64 uint64_t;
2525
#define HASH_LIBRARY_EXPORTED __declspec(dllimport)
2626
#endif
2727
#else
28-
#define HASH_LIBRARY_EXPORTED
28+
#define HASH_LIBRARY_EXPORTED __attribute__((visibility("default")))
2929
#endif
3030

3131
#else

src/libs/core/helper/windows.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#pragma once
22

3-
#if defined(_MSC_VER)
3+
#if defined(_MSC_VER) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
44
#if defined(OOPETRIS_LIBRARY_CORE_TYPE) && OOPETRIS_LIBRARY_CORE_TYPE == 0
55
#if defined(OOPETRIS_LIBRARY_CORE_EXPORT)
66
#define OOPETRIS_CORE_EXPORTED __declspec(dllexport)
77
#else
88
#define OOPETRIS_CORE_EXPORTED __declspec(dllimport)
99
#endif
1010
#else
11-
#define OOPETRIS_CORE_EXPORTED
11+
#define OOPETRIS_CORE_EXPORTED __attribute__((visibility("default")))
1212
#endif
1313
#else
1414
#define OOPETRIS_CORE_EXPORTED

src/libs/recordings/utility/windows.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#pragma once
22

3-
#if defined(_MSC_VER)
3+
#if defined(_MSC_VER) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
44
#if defined(OOPETRIS_LIBRARY_RECORDINGS_TYPE) && OOPETRIS_LIBRARY_RECORDINGS_TYPE == 0
55
#if defined(OOPETRIS_LIBRARY_RECORDINGS_EXPORT)
66
#define OOPETRIS_RECORDINGS_EXPORTED __declspec(dllexport)
77
#else
88
#define OOPETRIS_RECORDINGS_EXPORTED __declspec(dllimport)
99
#endif
1010
#else
11-
#define OOPETRIS_RECORDINGS_EXPORTED
11+
#define OOPETRIS_RECORDINGS_EXPORTED __attribute__((visibility("default")))
1212
#endif
1313
#else
1414
#define OOPETRIS_RECORDINGS_EXPORTED

0 commit comments

Comments
 (0)