Skip to content

Commit

Permalink
Update CMakeLists and #defines to support MSYS2/GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
Welch authored and Welch committed Nov 27, 2024
1 parent 83c6264 commit 3dfce15
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 555 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ if(WIN32)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
link_directories(${CMAKE_CURRENT_LIST_DIR}/oshw/win32/wpcap/Lib)
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_NO_WARNINGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
if(MSVC)
message(STATUS "Win32 MSVC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_NO_WARNINGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
else()
message(STATUS "Win32 non-MSVC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")
endif()
set(OS_LIBS wpcap.lib Packet.lib Ws2_32.lib Winmm.lib)
elseif(UNIX AND NOT APPLE)
set(OS "linux")
Expand Down
305 changes: 0 additions & 305 deletions osal/win32/inttypes.h

This file was deleted.

8 changes: 7 additions & 1 deletion osal/win32/osal_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ extern "C"
#endif

#ifndef PACKED
#define PACKED_BEGIN __pragma(pack(push, 1))
#define PACKED
#ifdef __GNUC__
#define PACKED_BEGIN
#define PACKED_END
#else
#define PACKED_BEGIN __pragma(pack(push, 1))
#define PACKED_END __pragma(pack(pop))
#endif

#endif

#define OSAL_THREAD_HANDLE HANDLE
#define OSAL_THREAD_FUNC void
#define OSAL_THREAD_FUNC_RT void
Expand Down
Loading

0 comments on commit 3dfce15

Please sign in to comment.