diff --git a/buffer/sc_buf.c b/buffer/sc_buf.c index 890770b..e43f44f 100644 --- a/buffer/sc_buf.c +++ b/buffer/sc_buf.c @@ -297,12 +297,12 @@ uint32_t sc_buf_set_data(struct sc_buf *buf, uint32_t offset, const void *src, } void sc_buf_set_32(struct sc_buf *buf, uint32_t val) { - sc_buf_set_data(buf, buf->wpos, &val, 4); + sc_buf_set_32_at(buf, buf->wpos, val); } void sc_buf_set_64(struct sc_buf *buf, uint64_t val) { - sc_buf_set_data(buf, buf->wpos, &val, 8); + sc_buf_set_64_at(buf, buf->wpos, val); } void sc_buf_set_8_at(struct sc_buf *buf, uint32_t pos, uint8_t val) diff --git a/signal/sc_signal.c b/signal/sc_signal.c index 967941c..8161d26 100644 --- a/signal/sc_signal.c +++ b/signal/sc_signal.c @@ -156,12 +156,14 @@ int sc_signal_snprintf(char *buf, size_t size, const char *fmt, ...) #if defined(_WIN32) #define WIN32_LEAN_AND_MEAN - #include - #include - #include - #include - #pragma warning(disable : 4996) +#include +#include +#include +#include + +#pragma warning(disable : 4996) +#pragma comment(lib, "Ws2_32.lib") static void sc_signal_log(int fd, char *buf, size_t len, char *fmt, ...) { diff --git a/signal/signal_test.c b/signal/signal_test.c index 0f6f5f0..2277afb 100644 --- a/signal/signal_test.c +++ b/signal/signal_test.c @@ -3,7 +3,6 @@ #include #include #include -#include void test1() { @@ -40,7 +39,7 @@ void test1() assert(sc_signal_snprintf(tmp, sizeof(tmp), "%llx", 3) == -1); assert(sc_signal_snprintf(tmp, sizeof(tmp), "%lx", 3) == -1); - sc_signal_log(STDOUT_FILENO, tmp, sizeof(tmp), "%s", "test"); + sc_signal_log(1, tmp, sizeof(tmp), "%s", "test"); } void test2()