mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-31 09:57:14 +01:00
Automatic OS identification.
This commit is contained in:
parent
a6ce7811ba
commit
b0e7c305b6
5
module/Vendor/SimpleSocket/CMakeLists.txt
vendored
5
module/Vendor/SimpleSocket/CMakeLists.txt
vendored
@ -12,9 +12,6 @@ target_include_directories(SimpleSocket PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include
|
||||
# Configure macro options
|
||||
target_compile_definitions(SimpleSocket PRIVATE _WIN32_WINNT=0x0601)
|
||||
# OS and compiler checks.
|
||||
if(UNIX)
|
||||
target_compile_definitions(SimpleSocket PRIVATE _LINUX=1)
|
||||
elseif(WIN32)
|
||||
target_compile_definitions(SimpleSocket PRIVATE _WIN32=1)
|
||||
if(WIN32)
|
||||
target_link_libraries(SimpleSocket PUBLIC Ws2_32)
|
||||
endif()
|
||||
|
13
module/Vendor/SimpleSocket/include/Host.h
vendored
13
module/Vendor/SimpleSocket/include/Host.h
vendored
@ -54,6 +54,19 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* */
|
||||
/* OS Identification */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(__WIN64__) || defined(_WIN) || defined(__WIN__)
|
||||
#ifndef _WIN32
|
||||
#define _WIN32 // why do I even bother?
|
||||
#endif
|
||||
#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__unix) || defined(__unix__)
|
||||
#define _LINUX
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* */
|
||||
/* Type Definition Macros */
|
||||
|
@ -43,6 +43,10 @@
|
||||
#ifndef __SOCKET_H__
|
||||
#define __SOCKET_H__
|
||||
|
||||
#ifdef _LINUX
|
||||
#define _DEFAULT_SOURCE
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
@ -51,6 +51,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef _LINUX
|
||||
#define _DEFAULT_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user