-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
This is because malloc, free, and realloc are explicitly __cdecl regardless of the default calling convention. Here are some example errors:
cJSON\cJSON.c(175): error C2440: '=': cannot convert from 'void *(__cdecl *)(std::size_t)' to 'void *(__stdcall *)(std::size_t)'
cJSON\cJSON.c(176): error C2440: '=': cannot convert from 'void (__cdecl *)(void *)' to 'void (__stdcall *)(void *)'
cJSON\cJSON.c(177): error C2440: '=': cannot convert from 'void *(__cdecl *)(void *,std::size_t)' to 'void *(__stdcall *)(void *,std::size_t)'
cJSON\cJSON.c(181): error C2440: '=': cannot convert from 'void *(__cdecl *)(std::size_t)' to 'void *(__stdcall *)(std::size_t)'
cJSON\cJSON.c(187): error C2440: '=': cannot convert from 'void (__cdecl *)(void *)' to 'void (__stdcall *)(void *)'
cJSON\cJSON.c(195): error C2440: '==': cannot convert from 'void *(__cdecl *)(std::size_t)' to 'void *(__stdcall *)(std::size_t)'
cJSON\cJSON.c(195): error C2440: '==': cannot convert from 'void (__cdecl *)(void *)' to 'void (__stdcall *)(void *)'
cJSON\cJSON.c(197): error C2440: '=': cannot convert from 'void *(__cdecl *)(void *,std::size_t)' to 'void *(__stdcall *)(void *,std::size_t)'I have submitted a pull request that fixes the issues here.
Metadata
Metadata
Assignees
Labels
No labels