Skip to content

Commit adcd33b

Browse files
unittests: fix windows build
1 parent b08dc22 commit adcd33b

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

UNITTESTS/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ endmacro()
1919

2020
use_cxx14()
2121

22+
23+
if (MINGW)
24+
# enable PRIx formatting globally
25+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__STDC_FORMAT_MACROS")
26+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_FORMAT_MACROS")
27+
endif (MINGW)
28+
2229
####################
2330
# GTEST
2431
####################

UNITTESTS/target_h/rtos/Semaphore.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
namespace rtos {
2424
class Semaphore {
2525
public:
26-
Semaphore(int32_t count = 0) {};
27-
Semaphore(int32_t count, uint16_t max_count) {};
28-
void acquire() {};
29-
bool try_acquire() { return false; };
30-
bool try_acquire_for(uint32_t millisec) { return false; };
31-
bool try_acquire_until(uint64_t millisec) { return false; };
32-
osStatus release(void) {return 0;};
26+
Semaphore(int32_t count = 0);
27+
Semaphore(int32_t count, uint16_t max_count);
28+
void acquire();
29+
bool try_acquire();
30+
bool try_acquire_for(uint32_t millisec);
31+
bool try_acquire_until(uint64_t millisec);
32+
osStatus release(void);
3333
};
3434
}
3535

events/internal/equeue_platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern "C" {
3535
// Try to infer a platform if none was manually selected
3636
#if !defined(EQUEUE_PLATFORM_POSIX) \
3737
&& !defined(EQUEUE_PLATFORM_MBED)
38-
#if defined(__unix__)
38+
#if defined(__unix__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(TARGET_OS_OSX)
3939
#define EQUEUE_PLATFORM_POSIX
4040
#elif defined(__MBED__)
4141
#define EQUEUE_PLATFORM_MBED

0 commit comments

Comments
 (0)