include/msvcrt: Add __WINE_(DEALLOC|MALLOC) attributes to _strdup and _wcsdup.
This commit is contained in:
parent
8e942f9e41
commit
3a688e81a6
3 changed files with 16 additions and 2 deletions
|
@ -342,4 +342,16 @@ typedef struct threadlocaleinfostruct {
|
|||
#define __WINE_CRT_SCANF_ATTR(fmt,args)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ > 10)
|
||||
#define __WINE_DEALLOC(...) __attribute__((malloc (__VA_ARGS__)))
|
||||
#else
|
||||
#define __WINE_DEALLOC(...)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2)
|
||||
#define __WINE_MALLOC __attribute__((malloc))
|
||||
#else
|
||||
#define __WINE_MALLOC
|
||||
#endif
|
||||
|
||||
#endif /* __WINE_CORECRT_H */
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define _WSTRING_DEFINED
|
||||
|
||||
#include <corecrt.h>
|
||||
#include <corecrt_malloc.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -29,7 +30,7 @@ static inline void* memccpy(void *s1, const void *s2, int c, size_t n) { return
|
|||
|
||||
_ACRTIMP void* __cdecl memmove(void*,const void*,size_t);
|
||||
|
||||
_ACRTIMP wchar_t* __cdecl _wcsdup(const wchar_t*);
|
||||
_ACRTIMP wchar_t* __cdecl _wcsdup(const wchar_t*) __WINE_DEALLOC(free) __WINE_MALLOC;
|
||||
_ACRTIMP int __cdecl _wcsicmp(const wchar_t*,const wchar_t*);
|
||||
_ACRTIMP int __cdecl _wcsicoll(const wchar_t*,const wchar_t*);
|
||||
_ACRTIMP int __cdecl _wcsicoll_l(const wchar_t*, const wchar_t*, _locale_t);
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#ifndef __WINE_STRING_H
|
||||
#define __WINE_STRING_H
|
||||
|
||||
#include <corecrt_malloc.h>
|
||||
#include <corecrt_wstring.h>
|
||||
|
||||
#ifndef _NLSCMP_DEFINED
|
||||
|
@ -22,7 +23,7 @@ extern "C" {
|
|||
_ACRTIMP size_t __cdecl __strncnt(const char*,size_t);
|
||||
_ACRTIMP int __cdecl _strcmpi(const char*,const char*);
|
||||
_ACRTIMP int __cdecl _strcoll_l(const char*, const char*, _locale_t);
|
||||
_ACRTIMP char* __cdecl _strdup(const char*);
|
||||
_ACRTIMP char* __cdecl _strdup(const char*) __WINE_DEALLOC(free) __WINE_MALLOC;
|
||||
_ACRTIMP char* __cdecl _strerror(const char*);
|
||||
_ACRTIMP errno_t __cdecl strerror_s(char*,size_t,int);
|
||||
_ACRTIMP int __cdecl _stricmp(const char*,const char*);
|
||||
|
|
Loading…
Add table
Reference in a new issue