From 3cab5e701caddc1beaa81fe02162acdaa2004493 Mon Sep 17 00:00:00 2001 From: correy <112426112@qq.com> Date: Wed, 29 Sep 2021 10:05:57 +0800 Subject: [PATCH] fix Issue #723. --- arraylist.c | 4 ++-- arraylist.h | 4 ++-- json_object.c | 4 ++-- json_object.h | 4 ++-- strerror_override.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arraylist.c b/arraylist.c index 7e12d98..e39e4c1 100644 --- a/arraylist.c +++ b/arraylist.c @@ -166,13 +166,13 @@ int array_list_add(struct array_list *arr, void *data) return 0; } -void array_list_sort(struct array_list *arr, int(__cdecl *compar)(const void *, const void *)) +void array_list_sort(struct array_list *arr, int(_cdecl *compar)(const void *, const void *)) { qsort(arr->array, arr->length, sizeof(arr->array[0]), compar); } void *array_list_bsearch(const void **key, struct array_list *arr, - int(__cdecl *compar)(const void *, const void *)) + int(_cdecl *compar)(const void *, const void *)) { return bsearch(key, arr->array, arr->length, sizeof(arr->array[0]), compar); } diff --git a/arraylist.h b/arraylist.h index 65b8acf..5966559 100644 --- a/arraylist.h +++ b/arraylist.h @@ -69,10 +69,10 @@ extern int array_list_add(struct array_list *al, void *data); extern size_t array_list_length(struct array_list *al); extern void array_list_sort(struct array_list *arr, - int(__cdecl *compar)(const void *, const void *)); + int(_cdecl *compar)(const void *, const void *)); extern void *array_list_bsearch(const void **key, struct array_list *arr, - int(__cdecl *compar)(const void *, const void *)); + int(_cdecl *compar)(const void *, const void *)); extern int array_list_del_idx(struct array_list *arr, size_t idx, size_t count); diff --git a/json_object.c b/json_object.c index b50a33d..d9227a7 100644 --- a/json_object.c +++ b/json_object.c @@ -1464,7 +1464,7 @@ struct array_list *json_object_get_array(const struct json_object *jso) } void json_object_array_sort(struct json_object *jso, - int(__cdecl *sort_fn)(const void *, const void *)) + int(_cdecl *sort_fn)(const void *, const void *)) { assert(json_object_get_type(jso) == json_type_array); array_list_sort(JC_ARRAY(jso)->c_array, sort_fn); @@ -1472,7 +1472,7 @@ void json_object_array_sort(struct json_object *jso, struct json_object *json_object_array_bsearch(const struct json_object *key, const struct json_object *jso, - int(__cdecl *sort_fn)(const void *, const void *)) + int(_cdecl *sort_fn)(const void *, const void *)) { struct json_object **result; diff --git a/json_object.h b/json_object.h index 06c0349..7150291 100644 --- a/json_object.h +++ b/json_object.h @@ -556,7 +556,7 @@ JSON_EXPORT size_t json_object_array_length(const struct json_object *obj); * @param sort_fn a sorting function */ JSON_EXPORT void json_object_array_sort(struct json_object *jso, - int(__cdecl *sort_fn)(const void *, const void *)); + int(_cdecl *sort_fn)(const void *, const void *)); /** Binary search a sorted array for a specified key object. * @@ -574,7 +574,7 @@ JSON_EXPORT void json_object_array_sort(struct json_object *jso, */ JSON_EXPORT struct json_object * json_object_array_bsearch(const struct json_object *key, const struct json_object *jso, - int(__cdecl *sort_fn)(const void *, const void *)); + int(_cdecl *sort_fn)(const void *, const void *)); /** Add an element to the end of a json_object of type json_type_array * diff --git a/strerror_override.c b/strerror_override.c index 694f816..35f2bfd 100644 --- a/strerror_override.c +++ b/strerror_override.c @@ -60,7 +60,7 @@ static struct // Enabled during tests static int _json_c_strerror_enable = 0; -extern char * __cdecl getenv(const char *name); // Avoid including stdlib.h +extern char * _cdecl getenv(const char *name); // Avoid including stdlib.h #define PREFIX "ERRNO=" static char errno_buf[128] = PREFIX;