summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/kit.inl.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/include/kit.inl.h b/include/kit.inl.h
index aa3740d..da90638 100644
--- a/include/kit.inl.h
+++ b/include/kit.inl.h
@@ -3,7 +3,7 @@
// kit.inl.h
// https://guattari.tech/kit.git
//
-// Single header-only utility library for C.
+// Single header-only cross-platform utility library for C.
//
// ================================================================
//
@@ -1769,15 +1769,15 @@ kit_sha256_hash_t kit_sha256(i64 size, u8 *data);
# pragma GCC diagnostic ignored "-Wunused-function"
# pragma GCC diagnostic ignored "-Wunknown-pragmas"
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
# if defined(_WIN32) && !defined(__CYGWIN__)
# define WIN32_LEAN_AND_MEAN
# include <winsock2.h>
# include <ws2tcpip.h>
# define socket_t SOCKET
# define socklen_t i32
-# ifdef __cplusplus
-extern "C" {
-# endif
static kit_status_t kit_sockets_init(void) {
WSADATA data;
memset(&data, 0, sizeof data);
@@ -1802,9 +1802,6 @@ static i32 kit_socket_set_nonblocking(socket_t s) {
? KIT_OK
: KIT_ERROR_SOCKET_CONTROL_FAILED;
}
-# ifdef __cplusplus
-}
-# endif
# else
# include <arpa/inet.h>
# include <errno.h>
@@ -1819,9 +1816,6 @@ static i32 kit_socket_set_nonblocking(socket_t s) {
# define socket_t i32
# define closesocket close
# define INVALID_SOCKET -1
-# ifdef __cplusplus
-extern "C" {
-# endif
static kit_status_t kit_sockets_init(void) {
signal(SIGPIPE, SIG_IGN);
return KIT_OK;
@@ -1841,9 +1835,9 @@ static i32 kit_socket_set_nonblocking(socket_t s) {
? KIT_OK
: KIT_ERROR_SOCKET_CONTROL_FAILED;
}
-# ifdef __cplusplus
+# endif
+# ifdef __cplusplus
}
-# endif
# endif
# ifdef __GNUC__
# pragma GCC diagnostic pop