From 1e5175d0d1752b77e220552d8685a6deb1c91be7 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Wed, 6 Mar 2019 21:50:13 +0900 Subject: [PATCH] Fix const error strings --- src/UDPC_Defines.h | 12 ++++++------ src/UDPConnection.c | 8 ++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/UDPC_Defines.h b/src/UDPC_Defines.h index 650f14a..f742f9c 100644 --- a/src/UDPC_Defines.h +++ b/src/UDPC_Defines.h @@ -24,12 +24,12 @@ #define UDPC_ERR_CVFAIL 5 // failed to create condition variable #define UDPC_ERR_THREADFAIL 6 // failed to create thread -static const char *UDPC_ERR_SOCKETFAIL_STR = "Failed to create socket"; -static const char *UDPC_ERR_SOCKETBINDF_STR = "Failed to bind socket"; -static const char *UDPC_ERR_SOCKETNONBF_STR = "Failed to set non-blocking on socket"; -static const char *UDPC_ERR_MTXFAIL_STR = "Failed to create mutex"; -static const char *UDPC_ERR_CVFAIL_STR = "Failed to create condition variable"; -static const char *UDPC_ERR_THREADFAIL_STR = "Failed to create thread"; +extern const char *UDPC_ERR_SOCKETFAIL_STR; +extern const char *UDPC_ERR_SOCKETBINDF_STR; +extern const char *UDPC_ERR_SOCKETNONBF_STR; +extern const char *UDPC_ERR_MTXFAIL_STR; +extern const char *UDPC_ERR_CVFAIL_STR; +extern const char *UDPC_ERR_THREADFAIL_STR; #define UDPC_CD_AMOUNT 32 diff --git a/src/UDPConnection.c b/src/UDPConnection.c index d1bbc6b..ba276e0 100644 --- a/src/UDPConnection.c +++ b/src/UDPConnection.c @@ -1,5 +1,13 @@ +#include "UDPC_Defines.h" #include "UDPConnection.h" +const char *UDPC_ERR_SOCKETFAIL_STR = "Failed to create socket"; +const char *UDPC_ERR_SOCKETBINDF_STR = "Failed to bind socket"; +const char *UDPC_ERR_SOCKETNONBF_STR = "Failed to set non-blocking on socket"; +const char *UDPC_ERR_MTXFAIL_STR = "Failed to create mutex"; +const char *UDPC_ERR_CVFAIL_STR = "Failed to create condition variable"; +const char *UDPC_ERR_THREADFAIL_STR = "Failed to create thread"; + #include #include #include