@@ -65,7 +65,7 @@ typedef intptr_t ssize_t;
6565 * `indent` is used for printing nested model objects
6666 */
6767
68- #define MODEL_API
68+ #define MODEL_VISIBILITY
6969
7070#define MODEL_JSON_COMPACT 0x1
7171
@@ -85,16 +85,16 @@ DECLARE_MODEL_FUNCS(type)
8585
8686#define DECLARE_MODEL_FUNCS (T ) \
8787typedef T ** T##_array; \
88- MODEL_API const type_meta* get_##T##_meta();\
88+ MODEL_VISIBILITY const type_meta* get_##T##_meta();\
8989static inline ptr(T) alloc_##T(){ return (ptr(T))model_alloc(get_##T##_meta()); }\
9090static inline void free_##T(ptr(T) v) { model_free(v, get_##T##_meta()); } \
9191static inline void free_##T##_ptr(ptr(T) v) { model_free(v, get_##T##_meta()); free(v); }; \
9292static inline int cmp_##T(const ptr(T) lh, const ptr(T) rh) { return model_cmp(lh, rh, get_##T##_meta()); } \
93- MODEL_API void free_##T##_array(array(T) *ap);\
94- MODEL_API int parse_##T(ptr(T) v, const char* json, size_t len);\
95- MODEL_API int parse_##T##_ptr(ptr(T) *p, const char* json, size_t len);\
96- MODEL_API int parse_##T##_array(array(T) *a, const char* json, size_t len); \
97- MODEL_API int parse_##T##_list(list(T) *l, const char* json, size_t len); \
93+ MODEL_VISIBILITY void free_##T##_array(array(T) *ap);\
94+ MODEL_VISIBILITY int parse_##T(ptr(T) v, const char* json, size_t len);\
95+ MODEL_VISIBILITY int parse_##T##_ptr(ptr(T) *p, const char* json, size_t len);\
96+ MODEL_VISIBILITY int parse_##T##_array(array(T) *a, const char* json, size_t len); \
97+ MODEL_VISIBILITY int parse_##T##_list(list(T) *l, const char* json, size_t len); \
9898static inline ssize_t T##_to_json_r(const ptr(T) v, int flags, char *outbuf, size_t max) { return model_to_json_r(v, get_##T##_meta(), flags, outbuf, max); } \
9999static inline char* T##_to_json(const ptr(T) v, int flags, size_t *len) { return model_to_json(v, get_##T##_meta(), flags, len); } \
100100static inline int T##_from_json(ptr(T) v, struct json_object *j) { return model_from_json(v, j, get_##T##_meta()); } \
@@ -276,7 +276,7 @@ Enum (*value_of)(const char* n); \
276276Enum (*value_ofn)(const char* s, size_t n); \
277277Values(enum_field, Enum) \
278278}; \
279- MODEL_API const type_meta* get_##Enum##_meta();\
279+ MODEL_VISIBILITY const type_meta* get_##Enum##_meta();\
280280extern const struct Enum##_s Enum##s;
281281
282282#define get_value_of_ovrd (_1 , _2 , _3 , _4 , _5 , NAME , ...) NAME
0 commit comments