From 541477736dc9d0c7fc358413a5910e6d513c29eb Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Mon, 25 Sep 2023 02:27:58 +0200 Subject: Update comments --- gen_inl.c | 2 +- include/kit.inl.h | 18 ++++++------------ source/kit/http1.h | 5 +++++ 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 # include # 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 # include @@ -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. // -- cgit v1.2.3