Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ add_custom_target(
)
set_target_properties(generate_version PROPERTIES FOLDER tinycsocket)

# Header generation
# Header generation (requires GNU m4 for undivert with filename)
find_program(M4_EXECUTABLE gm4 m4 REQUIRED)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/include/tinycsocket.h
COMMAND
m4 ${CMAKE_CURRENT_SOURCE_DIR}/src/tinycsocket.h.m4 >
${M4_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/tinycsocket.h.m4 >
${CMAKE_CURRENT_SOURCE_DIR}/include/tinycsocket.h
DEPENDS ${TINYCSOCKET_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tinycsocket.h.m4
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src
Expand Down
10 changes: 5 additions & 5 deletions include/tinycsocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#ifndef TINYCSOCKET_INTERNAL_H_
#define TINYCSOCKET_INTERNAL_H_

static const char* const TCS_VERSION_TXT = "v0.3.59";
static const char* const TCS_VERSION_TXT = "v0.3.60";
static const char* const TCS_LICENSE_TXT =
"Copyright 2018 Markus Lindelöw\n"
"\n"
Expand Down Expand Up @@ -191,10 +191,9 @@ typedef unsigned int TcsInterfaceId; // TODO: GUID is used for in vista at newer
#elif defined(TINYCSOCKET_USE_POSIX_IMPL)

#if defined(TINYCSOCKET_IMPLEMENTATION) || defined(TCS_DEFINE_POSIX_MACROS)
// POSIX feature test macros must be set before any system header is included.
// Without these, glibc's <features.h> (pulled in by <stdbool.h>) locks in
// strict C99 defaults that hide AI_PASSIVE, struct addrinfo, struct timeval,
// u_short, SO_REUSEPORT, etc.
// Only needed on glibc/Cygwin where -std=c99 restricts symbol visibility.
// On BSD/musl, setting these RESTRICTS visibility instead of expanding it.
#if defined(__linux__) || defined(__CYGWIN__)
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
Expand All @@ -208,6 +207,7 @@ typedef unsigned int TcsInterfaceId; // TODO: GUID is used for in vista at newer
#define _DEFAULT_SOURCE
#endif
#endif
#endif

typedef int TcsSocket;
typedef unsigned int TcsInterfaceId;
Expand Down
10 changes: 5 additions & 5 deletions src/tinycsocket_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef TINYCSOCKET_INTERNAL_H_
#define TINYCSOCKET_INTERNAL_H_

static const char* const TCS_VERSION_TXT = "v0.3.59";
static const char* const TCS_VERSION_TXT = "v0.3.60";
static const char* const TCS_LICENSE_TXT =
"Copyright 2018 Markus Lindelöw\n"
"\n"
Expand Down Expand Up @@ -185,10 +185,9 @@ typedef unsigned int TcsInterfaceId; // TODO: GUID is used for in vista at newer
#elif defined(TINYCSOCKET_USE_POSIX_IMPL)

#if defined(TINYCSOCKET_IMPLEMENTATION) || defined(TCS_DEFINE_POSIX_MACROS)
// POSIX feature test macros must be set before any system header is included.
// Without these, glibc's <features.h> (pulled in by <stdbool.h>) locks in
// strict C99 defaults that hide AI_PASSIVE, struct addrinfo, struct timeval,
// u_short, SO_REUSEPORT, etc.
// Only needed on glibc/Cygwin where -std=c99 restricts symbol visibility.
// On BSD/musl, setting these RESTRICTS visibility instead of expanding it.
#if defined(__linux__) || defined(__CYGWIN__)
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
Expand All @@ -202,6 +201,7 @@ typedef unsigned int TcsInterfaceId; // TODO: GUID is used for in vista at newer
#define _DEFAULT_SOURCE
#endif
#endif
#endif

typedef int TcsSocket;
typedef unsigned int TcsInterfaceId;
Expand Down
70 changes: 70 additions & 0 deletions t
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
diff --git a/include/tinycsocket.h b/include/tinycsocket.h
index 5036e60..b06ef0c 100644
--- a/include/tinycsocket.h
+++ b/include/tinycsocket.h
@@ -29,7 +29,7 @@
#ifndef TINYCSOCKET_INTERNAL_H_
#define TINYCSOCKET_INTERNAL_H_

-static const char* const TCS_VERSION_TXT = "v0.3.59";
+static const char* const TCS_VERSION_TXT = "v0.3.60";
static const char* const TCS_LICENSE_TXT =
"Copyright 2018 Markus Lindelöw\n"
"\n"
@@ -191,10 +191,9 @@ typedef unsigned int TcsInterfaceId; // TODO: GUID is used for in vista at newer
#elif defined(TINYCSOCKET_USE_POSIX_IMPL)

#if defined(TINYCSOCKET_IMPLEMENTATION) || defined(TCS_DEFINE_POSIX_MACROS)
-// POSIX feature test macros must be set before any system header is included.
-// Without these, glibc's <features.h> (pulled in by <stdbool.h>) locks in
-// strict C99 defaults that hide AI_PASSIVE, struct addrinfo, struct timeval,
-// u_short, SO_REUSEPORT, etc.
+// Only needed on glibc/Cygwin where -std=c99 restricts symbol visibility.
+// On BSD/musl, setting these RESTRICTS visibility instead of expanding it.
+#if defined(__linux__) || defined(__CYGWIN__)
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
@@ -208,6 +207,7 @@ typedef unsigned int TcsInterfaceId; // TODO: GUID is used for in vista at newer
#define _DEFAULT_SOURCE
#endif
#endif
+#endif

typedef int TcsSocket;
typedef unsigned int TcsInterfaceId;
diff --git a/src/tinycsocket_internal.h b/src/tinycsocket_internal.h
index a2c5b27..3c4db85 100644
--- a/src/tinycsocket_internal.h
+++ b/src/tinycsocket_internal.h
@@ -23,7 +23,7 @@
#ifndef TINYCSOCKET_INTERNAL_H_
#define TINYCSOCKET_INTERNAL_H_

-static const char* const TCS_VERSION_TXT = "v0.3.59";
+static const char* const TCS_VERSION_TXT = "v0.3.60";
static const char* const TCS_LICENSE_TXT =
"Copyright 2018 Markus Lindelöw\n"
"\n"
@@ -185,10 +185,9 @@ typedef unsigned int TcsInterfaceId; // TODO: GUID is used for in vista at newer
#elif defined(TINYCSOCKET_USE_POSIX_IMPL)

#if defined(TINYCSOCKET_IMPLEMENTATION) || defined(TCS_DEFINE_POSIX_MACROS)
-// POSIX feature test macros must be set before any system header is included.
-// Without these, glibc's <features.h> (pulled in by <stdbool.h>) locks in
-// strict C99 defaults that hide AI_PASSIVE, struct addrinfo, struct timeval,
-// u_short, SO_REUSEPORT, etc.
+// Only needed on glibc/Cygwin where -std=c99 restricts symbol visibility.
+// On BSD/musl, setting these RESTRICTS visibility instead of expanding it.
+#if defined(__linux__) || defined(__CYGWIN__)
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
@@ -202,6 +201,7 @@ typedef unsigned int TcsInterfaceId; // TODO: GUID is used for in vista at newer
#define _DEFAULT_SOURCE
#endif
#endif
+#endif

typedef int TcsSocket;
typedef unsigned int TcsInterfaceId;
Loading