* include/_mingw.h: Use only two underscores to uglify

__MINGW_ATTRIB_* macros.
	* include/stdlib.h: Adjust __MINGW_ATTRIB_* tokens.
	* includ/setjmp.h: Likewise.

	* include/sting.h: Add __MINGW_ATTRIB_PURE to locale-independent
	string functions.
	(_strdup, strdup): Add __MINGW_ATTRIB_MALLOC.
This commit is contained in:
Danny Smith 2004-07-26 09:13:42 +00:00
parent 174e6ff064
commit dcbe26ba3c
5 changed files with 66 additions and 55 deletions

View File

@ -1,3 +1,14 @@
2004-07-26 Danny Smith <dannysmith@users.sourceforge.net>
* include/_mingw.h: Use only two underscores to uglify
__MINGW_ATTRIB_* macros.
* include/stdlib.h: Adjust __MINGW_ATTRIB_* tokens.
* includ/setjmp.h: Likewise.
* include/sting.h: Add __MINGW_ATTRIB_PURE to locale-independent
string functions.
(_strdup, strdup): Add __MINGW_ATTRIB_MALLOC.
2004-07-25 Danny Smith <dannysmith@users.sourceforge.net>
* include/string.h: Group wide string functions together,
@ -5,7 +16,7 @@
2004-07-25 Danny Smith <dannysmith@users.sourceforge.net>
* include/_mingw.h (_MINGW_ATTR_*): Replace with
* include/_mingw.h (__MINGW_ATTR_*): Replace with
__MINGW_ATTRIB_*.
* include/stdlib.h (_ATTRIB_NORETURN): Replace with
__MINGW_ATTRIB_NOREURN, throughout.

View File

@ -121,19 +121,19 @@
#endif
#ifdef __GNUC__
#define ___MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
#define ___MINGW_ATTRIB_CONST __attribute__ ((__const__))
#define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
#define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
#else
#define ___MINGW_ATTRIB_NORETURN
#define ___MINGW_ATTRIB_CONST
#define __MINGW_ATTRIB_NORETURN
#define __MINGW_ATTRIB_CONST
#endif
#if ( __GNUC__ >= 3)
#define ___MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
#define ___MINGW_ATTRIB_PURE __attribute__ ((__pure__))
#define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
#define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
#else
#define ___MINGW_ATTRIB_MALLOC
#define ___MINGW_ATTRIB_PURE
#define __MINGW_ATTRIB_MALLOC
#define __MINGW_ATTRIB_PURE
#endif
#ifndef __MSVCRT_VERSION__

View File

@ -44,7 +44,7 @@ _CRTIMP int __cdecl _setjmp (jmp_buf);
* Return to the last setjmp call and act as if setjmp had returned
* nVal (which had better be non-zero!).
*/
_CRTIMP void __cdecl longjmp (jmp_buf, int) ___MINGW_ATTRIB_NORETURN;
_CRTIMP void __cdecl longjmp (jmp_buf, int) __MINGW_ATTRIB_NORETURN;
#ifdef __cplusplus
}

View File

@ -342,13 +342,13 @@ _CRTIMP int __cdecl mbtowc (wchar_t*, const char*, size_t);
_CRTIMP int __cdecl rand (void);
_CRTIMP void __cdecl srand (unsigned int);
_CRTIMP void* __cdecl calloc (size_t, size_t) ___MINGW_ATTRIB_MALLOC;
_CRTIMP void* __cdecl malloc (size_t) ___MINGW_ATTRIB_MALLOC;
_CRTIMP void* __cdecl calloc (size_t, size_t) __MINGW_ATTRIB_MALLOC;
_CRTIMP void* __cdecl malloc (size_t) __MINGW_ATTRIB_MALLOC;
_CRTIMP void* __cdecl realloc (void*, size_t);
_CRTIMP void __cdecl free (void*);
_CRTIMP void __cdecl abort (void) ___MINGW_ATTRIB_NORETURN;
_CRTIMP void __cdecl exit (int) ___MINGW_ATTRIB_NORETURN;
_CRTIMP void __cdecl abort (void) __MINGW_ATTRIB_NORETURN;
_CRTIMP void __cdecl exit (int) __MINGW_ATTRIB_NORETURN;
/* Note: This is in startup code, not imported directly from dll */
int __cdecl atexit (void (*)(void));
@ -362,8 +362,8 @@ _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t,
_CRTIMP void __cdecl qsort (void*, size_t, size_t,
int (*)(const void*, const void*));
_CRTIMP int __cdecl abs (int) ___MINGW_ATTRIB_CONST;
_CRTIMP long __cdecl labs (long) ___MINGW_ATTRIB_CONST;
_CRTIMP int __cdecl abs (int) __MINGW_ATTRIB_CONST;
_CRTIMP long __cdecl labs (long) __MINGW_ATTRIB_CONST;
/*
* div_t and ldiv_t are structures used to return the results of div and
@ -376,8 +376,8 @@ _CRTIMP long __cdecl labs (long) ___MINGW_ATTRIB_CONST;
typedef struct { int quot, rem; } div_t;
typedef struct { long quot, rem; } ldiv_t;
_CRTIMP div_t __cdecl div (int, int) ___MINGW_ATTRIB_CONST;
_CRTIMP ldiv_t __cdecl ldiv (long, long) ___MINGW_ATTRIB_CONST;
_CRTIMP div_t __cdecl div (int, int) __MINGW_ATTRIB_CONST;
_CRTIMP ldiv_t __cdecl ldiv (long, long) __MINGW_ATTRIB_CONST;
#if !defined (__STRICT_ANSI__)
@ -389,7 +389,7 @@ _CRTIMP void __cdecl _beep (unsigned int, unsigned int);
_CRTIMP void __cdecl _seterrormode (int);
_CRTIMP void __cdecl _sleep (unsigned long);
_CRTIMP void __cdecl _exit (int) ___MINGW_ATTRIB_NORETURN;
_CRTIMP void __cdecl _exit (int) __MINGW_ATTRIB_NORETURN;
/* _onexit is MS extension. Use atexit for portability. */
/* Note: This is in startup code, not imported directly from dll */
@ -430,10 +430,10 @@ _CRTIMP void __cdecl _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, con
_CRTIMP void __cdecl _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
_CRTIMP wchar_t* __cdecl _wfullpath (wchar_t*, const wchar_t*, size_t);
_CRTIMP unsigned int __cdecl _rotl(unsigned int, int) ___MINGW_ATTRIB_CONST;
_CRTIMP unsigned int __cdecl _rotr(unsigned int, int) ___MINGW_ATTRIB_CONST;
_CRTIMP unsigned long __cdecl _lrotl(unsigned long, int) ___MINGW_ATTRIB_CONST;
_CRTIMP unsigned long __cdecl _lrotr(unsigned long, int) ___MINGW_ATTRIB_CONST;
_CRTIMP unsigned int __cdecl _rotl(unsigned int, int) __MINGW_ATTRIB_CONST;
_CRTIMP unsigned int __cdecl _rotr(unsigned int, int) __MINGW_ATTRIB_CONST;
_CRTIMP unsigned long __cdecl _lrotl(unsigned long, int) __MINGW_ATTRIB_CONST;
_CRTIMP unsigned long __cdecl _lrotr(unsigned long, int) __MINGW_ATTRIB_CONST;
#endif
#ifndef _NO_OLDNAMES
@ -458,7 +458,7 @@ _CRTIMP char* __cdecl gcvt (double, int, char*);
#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
/* C99 name for _exit */
void __cdecl _Exit(int) ___MINGW_ATTRIB_NORETURN;
void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN;
#ifndef __STRICT_ANSI__ /* inline using non-ansi functions */
__CRT_INLINE void __cdecl _Exit(int status)
{ _exit(status); }
@ -466,7 +466,7 @@ __CRT_INLINE void __cdecl _Exit(int status)
typedef struct { long long quot, rem; } lldiv_t;
lldiv_t __cdecl lldiv (long long, long long) ___MINGW_ATTRIB_CONST;
lldiv_t __cdecl lldiv (long long, long long) __MINGW_ATTRIB_CONST;
__CRT_INLINE long long __cdecl llabs(long long _j)
{return (_j >= 0 ? _j : -_j);}

View File

@ -33,27 +33,27 @@ extern "C" {
/*
* Prototypes of the ANSI Standard C library string functions.
*/
_CRTIMP void* __cdecl memchr (const void*, int, size_t);
_CRTIMP int __cdecl memcmp (const void*, const void*, size_t);
_CRTIMP void* __cdecl memcpy (void*, const void*, size_t);
_CRTIMP void* __cdecl memmove (void*, const void*, size_t);
_CRTIMP void* __cdecl memset (void*, int, size_t);
_CRTIMP char* __cdecl strcat (char*, const char*);
_CRTIMP char* __cdecl strchr (const char*, int);
_CRTIMP int __cdecl strcmp (const char*, const char*);
_CRTIMP void* __cdecl memchr (const void*, int, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP int __cdecl memcmp (const void*, const void*, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP void* __cdecl memcpy (void*, const void*, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP void* __cdecl memmove (void*, const void*, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP void* __cdecl memset (void*, int, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strcat (char*, const char*) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strchr (const char*, int) __MINGW_ATTRIB_PURE;
_CRTIMP int __cdecl strcmp (const char*, const char*) __MINGW_ATTRIB_PURE;
_CRTIMP int __cdecl strcoll (const char*, const char*); /* Compare using locale */
_CRTIMP char* __cdecl strcpy (char*, const char*);
_CRTIMP size_t __cdecl strcspn (const char*, const char*);
_CRTIMP char* __cdecl strcpy (char*, const char*) __MINGW_ATTRIB_PURE;
_CRTIMP size_t __cdecl strcspn (const char*, const char*) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strerror (int); /* NOTE: NOT an old name wrapper. */
_CRTIMP size_t __cdecl strlen (const char*);
_CRTIMP char* __cdecl strncat (char*, const char*, size_t);
_CRTIMP int __cdecl strncmp (const char*, const char*, size_t);
_CRTIMP char* __cdecl strncpy (char*, const char*, size_t);
_CRTIMP char* __cdecl strpbrk (const char*, const char*);
_CRTIMP char* __cdecl strrchr (const char*, int);
_CRTIMP size_t __cdecl strspn (const char*, const char*);
_CRTIMP char* __cdecl strstr (const char*, const char*);
_CRTIMP size_t __cdecl strlen (const char*) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strncat (char*, const char*, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP int __cdecl strncmp (const char*, const char*, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strncpy (char*, const char*, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strpbrk (const char*, const char*) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strrchr (const char*, int) __MINGW_ATTRIB_PURE;
_CRTIMP size_t __cdecl strspn (const char*, const char*) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strstr (const char*, const char*) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strtok (char*, const char*);
_CRTIMP size_t __cdecl strxfrm (char*, const char*, size_t);
@ -62,19 +62,19 @@ _CRTIMP size_t __cdecl strxfrm (char*, const char*, size_t);
* Extra non-ANSI functions provided by the CRTDLL library
*/
_CRTIMP char* __cdecl _strerror (const char *);
_CRTIMP void* __cdecl _memccpy (void*, const void*, int, size_t);
_CRTIMP void* __cdecl _memccpy (void*, const void*, int, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP int __cdecl _memicmp (const void*, const void*, size_t);
_CRTIMP char* __cdecl _strdup (const char*);
_CRTIMP char* __cdecl _strdup (const char*) __MINGW_ATTRIB_MALLOC;
_CRTIMP int __cdecl _strcmpi (const char*, const char*);
_CRTIMP int __cdecl _stricmp (const char*, const char*);
_CRTIMP int __cdecl _stricoll (const char*, const char*);
_CRTIMP char* __cdecl _strlwr (char*);
_CRTIMP int __cdecl _strnicmp (const char*, const char*, size_t);
_CRTIMP char* __cdecl _strnset (char*, int, size_t);
_CRTIMP char* __cdecl _strrev (char*);
_CRTIMP char* __cdecl _strset (char*, int);
_CRTIMP char* __cdecl _strnset (char*, int, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl _strrev (char*) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl _strset (char*, int) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl _strupr (char*);
_CRTIMP void __cdecl _swab (const char*, char*, size_t);
_CRTIMP void __cdecl _swab (const char*, char*, size_t) __MINGW_ATTRIB_PURE;
#ifdef __MSVCRT__
_CRTIMP int __cdecl _strncoll(const char*, const char*, size_t);
@ -87,9 +87,9 @@ _CRTIMP int __cdecl _strnicoll(const char*, const char*, size_t);
* and provide a little extra portability. Also a few extra UNIX-isms like
* strcasecmp.
*/
_CRTIMP void* __cdecl memccpy (void*, const void*, int, size_t);
_CRTIMP void* __cdecl memccpy (void*, const void*, int, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP int __cdecl memicmp (const void*, const void*, size_t);
_CRTIMP char* __cdecl strdup (const char*);
_CRTIMP char* __cdecl strdup (const char*) __MINGW_ATTRIB_MALLOC;
_CRTIMP int __cdecl strcmpi (const char*, const char*);
_CRTIMP int __cdecl stricmp (const char*, const char*);
__CRT_INLINE int __cdecl
@ -101,12 +101,12 @@ _CRTIMP int __cdecl strnicmp (const char*, const char*, size_t);
__CRT_INLINE int __cdecl
strncasecmp (const char * __sz1, const char * __sz2, size_t __sizeMaxCompare)
{return _strnicmp (__sz1, __sz2, __sizeMaxCompare);}
_CRTIMP char* __cdecl strnset (char*, int, size_t);
_CRTIMP char* __cdecl strrev (char*);
_CRTIMP char* __cdecl strset (char*, int);
_CRTIMP char* __cdecl strnset (char*, int, size_t) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strrev (char*) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strset (char*, int) __MINGW_ATTRIB_PURE;
_CRTIMP char* __cdecl strupr (char*);
#ifndef _UWIN
_CRTIMP void __cdecl swab (const char*, char*, size_t);
_CRTIMP void __cdecl swab (const char*, char*, size_t) __MINGW_ATTRIB_PURE;
#endif /* _UWIN */
#endif /* _NO_OLDNAMES */