summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-25 02:27:58 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-25 02:27:58 +0200
commit541477736dc9d0c7fc358413a5910e6d513c29eb (patch)
treeb6c115b088ebed0a21c9a0bb3dba77c4ecbb84f2
parent557ca6ef1cf0031846a62cd2e282a0b0aea2d534 (diff)
downloadkit-541477736dc9d0c7fc358413a5910e6d513c29eb.zip
Update comments
-rw-r--r--gen_inl.c2
-rw-r--r--include/kit.inl.h18
-rw-r--r--source/kit/http1.h5
3 files changed, 12 insertions, 13 deletions
diff --git a/gen_inl.c b/gen_inl.c
index 1e99058..975b7a5 100644
--- a/gen_inl.c
+++ b/gen_inl.c
@@ -147,7 +147,7 @@ int main(int argc, char **argv) {
fprintf(out, "// kit.inl.h\n");
fprintf(out, "// https://guattari.tech/kit.git\n");
fprintf(out, "//\n");
- fprintf(out, "// Single header-only utility library for C.\n");
+ fprintf(out, "// Single header-only cross-platform utility library for C.\n");
fprintf(out, "//\n");
fprintf(out, "// "
"====================================================="
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
diff --git a/source/kit/http1.h b/source/kit/http1.h
index 3158bd6..0493d46 100644
--- a/source/kit/http1.h
+++ b/source/kit/http1.h
@@ -9,6 +9,11 @@
extern "C" {
#endif
+// TODO
+// - Add source to README
+// https://github.com/csachs/picohttpclient/tree/master
+//
+
// FIXME
// Rewrite in C.
//