Browse Source

Use CJSON_PUBLIC for typecheck functions

Max Bruckner 8 years ago
parent
commit
412f4f7d62
2 changed files with 23 additions and 23 deletions
  1. 10 10
      cJSON.c
  2. 13 13
      cJSON.h

+ 10 - 10
cJSON.c

@@ -2185,7 +2185,7 @@ CJSON_PUBLIC(void) cJSON_Minify(char *json)
     *into = '\0';
 }
 
-extern cjbool cJSON_IsInvalid(const cJSON * const item)
+CJSON_PUBLIC(cjbool) cJSON_IsInvalid(const cJSON * const item)
 {
     if (item == NULL)
     {
@@ -2195,7 +2195,7 @@ extern cjbool cJSON_IsInvalid(const cJSON * const item)
     return (item->type & 0xFF) == cJSON_Invalid;
 }
 
-extern cjbool cJSON_IsFalse(const cJSON * const item)
+CJSON_PUBLIC(cjbool) cJSON_IsFalse(const cJSON * const item)
 {
     if (item == NULL)
     {
@@ -2205,7 +2205,7 @@ extern cjbool cJSON_IsFalse(const cJSON * const item)
     return (item->type & 0xFF) == cJSON_False;
 }
 
-extern cjbool cJSON_IsTrue(const cJSON * const item)
+CJSON_PUBLIC(cjbool) cJSON_IsTrue(const cJSON * const item)
 {
     if (item == NULL)
     {
@@ -2216,7 +2216,7 @@ extern cjbool cJSON_IsTrue(const cJSON * const item)
 }
 
 
-extern cjbool cJSON_IsBool(const cJSON * const item)
+CJSON_PUBLIC(cjbool) cJSON_IsBool(const cJSON * const item)
 {
     if (item == NULL)
     {
@@ -2225,7 +2225,7 @@ extern cjbool cJSON_IsBool(const cJSON * const item)
 
     return (item->type & (cJSON_True | cJSON_False)) != 0;
 }
-extern cjbool cJSON_IsNull(const cJSON * const item)
+CJSON_PUBLIC(cjbool) cJSON_IsNull(const cJSON * const item)
 {
     if (item == NULL)
     {
@@ -2235,7 +2235,7 @@ extern cjbool cJSON_IsNull(const cJSON * const item)
     return (item->type & 0xFF) == cJSON_NULL;
 }
 
-extern cjbool cJSON_IsNumber(const cJSON * const item)
+CJSON_PUBLIC(cjbool) cJSON_IsNumber(const cJSON * const item)
 {
     if (item == NULL)
     {
@@ -2245,7 +2245,7 @@ extern cjbool cJSON_IsNumber(const cJSON * const item)
     return (item->type & 0xFF) == cJSON_Number;
 }
 
-extern cjbool cJSON_IsString(const cJSON * const item)
+CJSON_PUBLIC(cjbool) cJSON_IsString(const cJSON * const item)
 {
     if (item == NULL)
     {
@@ -2255,7 +2255,7 @@ extern cjbool cJSON_IsString(const cJSON * const item)
     return (item->type & 0xFF) == cJSON_String;
 }
 
-extern cjbool cJSON_IsArray(const cJSON * const item)
+CJSON_PUBLIC(cjbool) cJSON_IsArray(const cJSON * const item)
 {
     if (item == NULL)
     {
@@ -2265,7 +2265,7 @@ extern cjbool cJSON_IsArray(const cJSON * const item)
     return (item->type & 0xFF) == cJSON_Array;
 }
 
-extern cjbool cJSON_IsObject(const cJSON * const item)
+CJSON_PUBLIC(cjbool) cJSON_IsObject(const cJSON * const item)
 {
     if (item == NULL)
     {
@@ -2275,7 +2275,7 @@ extern cjbool cJSON_IsObject(const cJSON * const item)
     return (item->type & 0xFF) == cJSON_Object;
 }
 
-extern cjbool cJSON_IsRaw(const cJSON * const item)
+CJSON_PUBLIC(cjbool) cJSON_IsRaw(const cJSON * const item)
 {
     if (item == NULL)
     {

+ 13 - 13
cJSON.h

@@ -33,9 +33,6 @@ extern "C"
 #define CJSON_VERSION_MINOR 3
 #define CJSON_VERSION_PATCH 0
 
-/* returns the version of cJSON as a string */
-extern const char* cJSON_Version(void);
-
 #include <stddef.h>
 
 /* cJSON Types: */
@@ -118,6 +115,9 @@ then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJ
 #endif
 #endif
 
+/* returns the version of cJSON as a string */
+CJSON_PUBLIC(const char*) cJSON_Version(void);
+
 /* Supply malloc, realloc and free functions to cJSON */
 CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks);
 
@@ -147,16 +147,16 @@ CJSON_PUBLIC(int) cJSON_HasObjectItem(const cJSON *object, const char *string);
 CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);
 
 /* These functions check the type of an item */
-extern int cJSON_IsInvalid(const cJSON * const item);
-extern int cJSON_IsFalse(const cJSON * const item);
-extern int cJSON_IsTrue(const cJSON * const item);
-extern int cJSON_IsBool(const cJSON * const item);
-extern int cJSON_IsNull(const cJSON * const item);
-extern int cJSON_IsNumber(const cJSON * const item);
-extern int cJSON_IsString(const cJSON * const item);
-extern int cJSON_IsArray(const cJSON * const item);
-extern int cJSON_IsObject(const cJSON * const item);
-extern int cJSON_IsRaw(const cJSON * const item);
+CJSON_PUBLIC(int) cJSON_IsInvalid(const cJSON * const item);
+CJSON_PUBLIC(int) cJSON_IsFalse(const cJSON * const item);
+CJSON_PUBLIC(int) cJSON_IsTrue(const cJSON * const item);
+CJSON_PUBLIC(int) cJSON_IsBool(const cJSON * const item);
+CJSON_PUBLIC(int) cJSON_IsNull(const cJSON * const item);
+CJSON_PUBLIC(int) cJSON_IsNumber(const cJSON * const item);
+CJSON_PUBLIC(int) cJSON_IsString(const cJSON * const item);
+CJSON_PUBLIC(int) cJSON_IsArray(const cJSON * const item);
+CJSON_PUBLIC(int) cJSON_IsObject(const cJSON * const item);
+CJSON_PUBLIC(int) cJSON_IsRaw(const cJSON * const item);
 
 /* These calls create a cJSON item of the appropriate type. */
 CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void);