From: nishi Date: Thu, 18 Jan 2024 12:35:23 +0000 (+0000) Subject: cpp support X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=107f40c148063c69fbfcd68c91085d69e9740be9;p=libw3.git cpp support git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@32 d27a3e52-49c5-7645-884c-6793ebffc270 --- diff --git a/Library/W3Core.h b/Library/W3Core.h index d7033e6..bc103af 100644 --- a/Library/W3Core.h +++ b/Library/W3Core.h @@ -2,6 +2,10 @@ #ifndef __W3CORE_H__ #define __W3CORE_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include #include "W3Version.h" @@ -28,4 +32,8 @@ void W3_Send_Request(struct W3* w3); /* Send the request */ void W3_Set_Header(struct W3* w3, const char* key, const char* value); /* Set the header */ void W3_Free(struct W3* w3); /* Free the struct */ +#ifdef __cplusplus +} +#endif + #endif diff --git a/Library/W3DNS.h b/Library/W3DNS.h index c34852a..e53e2ee 100644 --- a/Library/W3DNS.h +++ b/Library/W3DNS.h @@ -2,6 +2,10 @@ #ifndef __W3DNS_H__ #define __W3DNS_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -13,4 +17,8 @@ int __W3_DNS_Connect(const char* hostname, bool ssl, uint16_t port #endif ); +#ifdef __cplusplus +} +#endif + #endif diff --git a/Library/W3HTTP.h b/Library/W3HTTP.h index 33e655a..2000259 100644 --- a/Library/W3HTTP.h +++ b/Library/W3HTTP.h @@ -2,7 +2,15 @@ #ifndef __W3HTTP_H__ #define __W3HTTP_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include "W3Core.h" void __W3_HTTP_Request(struct W3* w3); +#ifdef __cplusplus +} +#endif + #endif diff --git a/Library/W3Util.h b/Library/W3Util.h index b03f55c..6fb36a3 100644 --- a/Library/W3Util.h +++ b/Library/W3Util.h @@ -2,6 +2,10 @@ #ifndef __W3UTIL_H__ #define __W3UTIL_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include "W3Core.h" #include @@ -15,4 +19,8 @@ unsigned long __W3_Auto_Read(struct W3* w3, char* data, unsigned long length); bool __W3_Have_Header(struct W3* w3, const char* name); char* __W3_Get_Platform(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/Makefile b/Makefile index b631811..69e65a5 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ endif echo "Libs: -I\$${libdir} -lw3" >> $@ clean: - -rm ./w3.pc *.zip *.tar.gz ./Library/W3Version.h + -rm ./w3.pc w3-*.zip w3-*.tar.gz w3-*.lzh ./Library/W3Version.h $(MAKE) -C ./Library clean $(MAKE) -C ./Example clean diff --git a/W3Version.h.p b/W3Version.h.p index 8cb59a0..31e674f 100644 --- a/W3Version.h.p +++ b/W3Version.h.p @@ -2,7 +2,15 @@ #ifndef __W3VERSION_H__ #define __W3VERSION_H__ +#ifdef __cplusplus +extern "C" { +#endif + #define LIBW3_VERSION "0.0" \ SUFFIX +#ifdef __cplusplus +} +#endif + #endif