Remove all stuff that is either already defined in crtdefs.h or doesn't belong in the header, based on what ms defines.

svn path=/trunk/; revision=38279
This commit is contained in:
Timo Kreuzer 2008-12-22 20:59:56 +00:00
parent 6da76aad1d
commit 940dd12ea9
12 changed files with 30 additions and 368 deletions

View file

@ -7,37 +7,14 @@
#define __ASSERT_H_
#include <crtdefs.h>
#ifdef __cplusplus
#include <stdlib.h>
#endif
#ifdef NDEBUG
#ifndef assert
#define assert(_Expression) ((void)0)
#endif
#else
#ifndef _CRT_TERMINATE_DEFINED
#define _CRT_TERMINATE_DEFINED
__declspec(noreturn) void __cdecl exit(int _Code);
_CRTIMP __declspec(noreturn) void __cdecl _exit(int _Code);
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
/* C99 function name */
void __cdecl __declspec(noreturn) _Exit(int); /* Declare to get noreturn attribute. */
__CRT_INLINE void __cdecl _Exit(int status)
{ _exit(status); }
#endif
#if __MINGW_GNUC_PREREQ(4,4)
#pragma push_macro("abort")
#undef abort
#endif
void __cdecl __declspec(noreturn) abort(void);
#if __MINGW_GNUC_PREREQ(4,4)
#pragma pop_macro("abort")
#endif
#endif
#else /* !NDEBUG */
#ifdef __cplusplus
extern "C" {

View file

@ -5,8 +5,6 @@
*/
#include <crtdefs.h>
#include <io.h>
#ifndef _INC_FCNTL
#define _INC_FCNTL

View file

@ -169,60 +169,6 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
#define _A_SUBDIR 0x10
#define _A_ARCH 0x20
#ifndef _SIZE_T_DEFINED
#define _SIZE_T_DEFINED
#undef size_t
#ifdef _WIN64
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
typedef unsigned int size_t __attribute__ ((mode (DI)));
#else
typedef unsigned __int64 size_t;
#endif
#else
typedef unsigned int size_t;
#endif
#endif
#ifndef _SSIZE_T_DEFINED
#define _SSIZE_T_DEFINED
#undef ssize_t
#ifdef _WIN64
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
typedef int ssize_t __attribute__ ((mode (DI)));
#else
typedef __int64 ssize_t;
#endif
#else
typedef int ssize_t;
#endif
#endif
#ifndef _OFF_T_DEFINED
#define _OFF_T_DEFINED
#ifndef _OFF_T_
#define _OFF_T_
typedef long _off_t;
#if !defined(NO_OLDNAMES) || defined(_POSIX)
typedef long off_t;
#endif
#endif
#endif
#ifndef _OFF64_T_DEFINED
#define _OFF64_T_DEFINED
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
typedef int _off64_t __attribute__ ((mode (DI)));
#if !defined(NO_OLDNAMES) || defined(_POSIX)
typedef int off64_t __attribute__ ((mode (DI)));
#endif
#else
typedef long long _off64_t;
#if !defined(NO_OLDNAMES) || defined(_POSIX)
typedef long long off64_t;
#endif
#endif
#endif
/* Some defines for _access nAccessMode (MS doesn't define them, but
* it doesn't seem to hurt to add them). */
#define F_OK 0 /* Check for file existence */
@ -248,7 +194,6 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
_CRTIMP int __cdecl _isatty(int _FileHandle);
_CRTIMP int __cdecl _locking(int _FileHandle,int _LockMode,long _NumOfBytes);
_CRTIMP long __cdecl _lseek(int _FileHandle,long _Offset,int _Origin);
_off64_t lseek64(int fd,_off64_t offset, int whence);
_CRTIMP char *__cdecl _mktemp(char *_TemplateName);
_CRTIMP int __cdecl _pipe(int *_PtHandles,unsigned int _PipeSize,int _TextMode);
_CRTIMP int __cdecl _read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount);

View file

@ -577,6 +577,4 @@ extern "C" {
#pragma pack(pop)
#include <sec_api/stdlib_s.h>
#include <malloc.h>
#endif

View file

@ -25,8 +25,6 @@ extern "C" {
#endif
#endif
#define _WConst_return _CONST_RETURN
#ifndef _CRT_MEMORY_DEFINED
#define _CRT_MEMORY_DEFINED
_CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount);

View file

@ -19,48 +19,8 @@
extern "C" {
#endif
#ifndef _CRTIMP
#define _CRTIMP __declspec(dllimport)
#endif
#include <sys/types.h>
#ifdef _USE_32BIT_TIME_T
#ifdef _WIN64
#undef _USE_32BIT_TIME_T
#endif
#else
#if _INTEGRAL_MAX_BITS < 64
#define _USE_32BIT_TIME_T
#endif
#endif
#ifndef _TIME32_T_DEFINED
typedef long __time32_t;
#define _TIME32_T_DEFINED
#endif
#ifndef _TIME64_T_DEFINED
#if _INTEGRAL_MAX_BITS >= 64
typedef __int64 __time64_t;
#endif
#define _TIME64_T_DEFINED
#endif
#ifndef _TIME_T_DEFINED
#ifdef _USE_32BIT_TIME_T
typedef __time32_t time_t;
#else
typedef __time64_t time_t;
#endif
#define _TIME_T_DEFINED
#endif
#ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif
#ifndef _STAT_DEFINED
struct _stat32 {

View file

@ -3,8 +3,8 @@
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _TIMEB_H_
#define _TIMEB_H_
#ifndef _INC_TIMEB
#define _INC_TIMEB
#include <crtdefs.h>
@ -18,41 +18,6 @@
extern "C" {
#endif
#ifndef _CRTIMP
#define _CRTIMP __declspec(dllimport)
#endif
#ifdef _USE_32BIT_TIME_T
#ifdef _WIN64
#undef _USE_32BIT_TIME_T
#endif
#else
#if _INTEGRAL_MAX_BITS < 64
#define _USE_32BIT_TIME_T
#endif
#endif
#ifndef _TIME32_T_DEFINED
typedef long __time32_t;
#define _TIME32_T_DEFINED
#endif
#ifndef _TIME64_T_DEFINED
#if _INTEGRAL_MAX_BITS >= 64
typedef __int64 __time64_t;
#endif
#define _TIME64_T_DEFINED
#endif
#ifndef _TIME_T_DEFINED
#ifdef _USE_32BIT_TIME_T
typedef __time32_t time_t;
#else
typedef __time64_t time_t;
#endif
#define _TIME_T_DEFINED
#endif
#ifndef _TIMEB_DEFINED
#define _TIMEB_DEFINED

View file

@ -12,37 +12,6 @@
#include <crtdefs.h>
#ifdef _USE_32BIT_TIME_T
#ifdef _WIN64
#undef _USE_32BIT_TIME_T
#endif
#else
#if _INTEGRAL_MAX_BITS < 64
#define _USE_32BIT_TIME_T
#endif
#endif
#ifndef _TIME32_T_DEFINED
#define _TIME32_T_DEFINED
typedef long __time32_t;
#endif
#ifndef _TIME64_T_DEFINED
#define _TIME64_T_DEFINED
#if _INTEGRAL_MAX_BITS >= 64
typedef __int64 __time64_t;
#endif
#endif
#ifndef _TIME_T_DEFINED
#define _TIME_T_DEFINED
#ifdef _USE_32BIT_TIME_T
typedef __time32_t time_t;
#else
typedef __time64_t time_t;
#endif
#endif
#ifndef _INO_T_DEFINED
#define _INO_T_DEFINED
typedef unsigned short _ino_t;
@ -59,58 +28,12 @@ typedef unsigned int dev_t;
#endif
#endif
#ifndef _PID_T_
#define _PID_T_
#ifndef _WIN64
typedef int _pid_t;
#else
typedef __int64 _pid_t;
#endif
#ifndef NO_OLDNAMES
typedef _pid_t pid_t;
#endif
#endif /* Not _PID_T_ */
#ifndef _MODE_T_
#define _MODE_T_
typedef unsigned short _mode_t;
#ifndef NO_OLDNAMES
typedef _mode_t mode_t;
#endif
#endif /* Not _MODE_T_ */
#ifndef _OFF_T_DEFINED
#define _OFF_T_DEFINED
#ifndef _OFF_T_
#define _OFF_T_
typedef long _off_t;
#if !defined(NO_OLDNAMES) || defined(_POSIX)
# ifndef NO_OLDNAMES
typedef long off_t;
#endif
#endif
# endif
#endif
#ifndef _OFF64_T_DEFINED
#define _OFF64_T_DEFINED
typedef long long _off64_t;
#if !defined(NO_OLDNAMES) || defined(_POSIX)
typedef long long off64_t;
#endif
#endif
#ifndef TIMESPEC_DEFINED
#define TIMESPEC_DEFINED
struct timespec {
time_t tv_sec; /* Seconds */
long tv_nsec; /* Nanoseconds */
};
struct itimerspec {
struct timespec it_interval; /* Timer period */
struct timespec it_value; /* Timer expiration */
};
#endif
#endif
#endif /* !_INC_TYPES */

View file

@ -18,46 +18,6 @@
extern "C" {
#endif
#ifndef _CRTIMP
#define _CRTIMP __declspec(dllimport)
#endif
#ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif
#ifdef _USE_32BIT_TIME_T
#ifdef _WIN64
#undef _USE_32BIT_TIME_T
#endif
#else
#if _INTEGRAL_MAX_BITS < 64
#define _USE_32BIT_TIME_T
#endif
#endif
#ifndef _TIME32_T_DEFINED
#define _TIME32_T_DEFINED
typedef long __time32_t;
#endif
#ifndef _TIME64_T_DEFINED
#define _TIME64_T_DEFINED
#if _INTEGRAL_MAX_BITS >= 64
typedef __int64 __time64_t;
#endif
#endif
#ifndef _TIME_T_DEFINED
#define _TIME_T_DEFINED
#ifdef _USE_32BIT_TIME_T
typedef __time32_t time_t;
#else
typedef __time64_t time_t;
#endif
#endif
#ifndef _UTIMBUF_DEFINED
#define _UTIMBUF_DEFINED

View file

@ -79,12 +79,14 @@ extern "C" {
#define _WConst_return _CONST_RETURN
#ifdef _UNICODE
#ifdef __cplusplus
}
#endif
#ifdef _UNICODE
/** UNICODE ******************************************************************/
#include <wchar.h>
#ifdef __cplusplus
@ -479,10 +481,7 @@ extern "C" {
#define _tseekdir _wseekdir
#else
#ifdef __cplusplus
}
#endif
/** ANSI *********************************************************************/
#include <string.h>
@ -753,6 +752,7 @@ extern "C" {
#define _tsetlocale setlocale
#ifdef _MBCS
/** MBCS *********************************************************************/
#ifdef __cplusplus
}
@ -851,7 +851,9 @@ extern "C" {
#define _tclen _mbclen
#define _tccpy _mbccpy
#define _tccpy_l _mbccpy_l
#else
#else /* !_MB_MAP_DIRECT */
_CRTIMP _CONST_RETURN char *__cdecl _tcschr(const char *_Str,unsigned int _Val);
_CRTIMP size_t __cdecl _tcscspn(const char *_Str,const char *_Control);
@ -957,7 +959,9 @@ extern "C" {
#define _istlead _ismbblead
#define _istleadbyte isleadbyte
#define _istleadbyte_l _isleadbyte_l
#else
#else /* !_MBCS */
/** SBCS *********************************************************************/
#ifndef __TCHAR_DEFINED
#define __TCHAR_DEFINED
@ -1106,8 +1110,10 @@ extern "C" {
#define _strtok_l(_String,_Delimiters,_Locale) (strtok(_String,_Delimiters))
#define _strnset_l(_Destination,_Value,_Count,_Locale) (_strnset(_Destination,_Value,_Count))
#define _strset_l(_Destination,_Value,_Locale) (_strset(_Destination,_Value))
#endif
#endif
#endif /* !_MBCS */
#endif /* !UNICODE */
/*****************************************************************************/
#define _T(x) __T(x)
#define _TEXT(x) __T(x)

View file

@ -18,15 +18,6 @@
extern "C" {
#endif
#ifndef _CRTIMP
#define _CRTIMP __declspec(dllimport)
#endif
#ifndef _WCHAR_T_DEFINED
#define _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#endif
#ifndef _TIME32_T_DEFINED
#define _TIME32_T_DEFINED
typedef long __time32_t;
@ -71,20 +62,6 @@ extern "C" {
#endif
#endif
#ifndef _SSIZE_T_DEFINED
#define _SSIZE_T_DEFINED
#undef ssize_t
#ifdef _WIN64
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
typedef int ssize_t __attribute__ ((mode (DI)));
#else
typedef __int64 ssize_t;
#endif
#else
typedef int ssize_t;
#endif
#endif
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
@ -181,7 +158,7 @@ __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_T
#endif
#define _WTIME_DEFINED
#endif
#endif /* !_WTIME_DEFINED */
#ifndef RC_INVOKED
double __cdecl difftime(time_t _Time1,time_t _Time2);
@ -224,17 +201,6 @@ __CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time64(_Time); }
void __cdecl tzset(void);
#endif
#ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
#define _TIMEVAL_DEFINED
struct timeval {
long tv_sec;
long tv_usec;
};
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#define timercmp(tvp,uvp,cmp) ((tvp)->tv_sec cmp (uvp)->tv_sec || (tvp)->tv_sec==(uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
#endif /* _TIMEVAL_DEFINED */
#ifdef __cplusplus
}
#endif
@ -243,8 +209,5 @@ struct timeval {
#include <sec_api/time_s.h>
/* Adding timespec definition. */
#include <sys/timeb.h>
#endif /* End _TIME_H_ */

View file

@ -21,16 +21,6 @@ extern "C" {
#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
#endif
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
typedef __builtin_va_list __gnuc_va_list;
#endif
#ifndef _VA_LIST_DEFINED
#define _VA_LIST_DEFINED
typedef __gnuc_va_list va_list;
#endif
#ifndef WEOF
#define WEOF (wint_t)(0xFFFF)
#endif
@ -148,12 +138,6 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
#endif
#endif
#ifndef _CONST_RETURN
#define _CONST_RETURN
#endif
#define _WConst_return _CONST_RETURN
#ifndef _CRT_CTYPEDATA_DEFINED
#define _CRT_CTYPEDATA_DEFINED
#ifndef _CTYPE_DISABLE_MACROS
@ -300,7 +284,7 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
extern "C++" _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,int _PermissionMode = 0);
extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0);
#endif
#endif
#endif /* !_WIO_DEFINED */
#ifndef _WLOCALE_DEFINED
#define _WLOCALE_DEFINED
@ -329,8 +313,8 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
#ifndef _CRT_WSYSTEM_DEFINED
#define _CRT_WSYSTEM_DEFINED
_CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
#endif
#endif
#endif /* !_CRT_WSYSTEM_DEFINED */
#endif /* !_WPROCESS_DEFINED */
#ifndef _WCTYPE_INLINE_DEFINED
#undef _CRT_WCTYPE_NOINLINE
@ -385,19 +369,16 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
#ifndef _OFF_T_DEFINED
#define _OFF_T_DEFINED
#ifndef _OFF_T_
#define _OFF_T_
typedef long _off_t;
#if !defined(NO_OLDNAMES) || defined(_POSIX)
#ifndef NO_OLDNAMES
typedef long off_t;
#endif
#endif
#endif
#ifndef _OFF64_T_DEFINED
#define _OFF64_T_DEFINED
typedef long long _off64_t;
#if !defined(NO_OLDNAMES) || defined(_POSIX)
#ifndef NO_OLDNAMES
typedef long long off64_t;
#endif
#endif
@ -520,11 +501,6 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
#ifndef _WCONIO_DEFINED
#define _WCONIO_DEFINED
#ifndef WEOF
#define WEOF (wint_t)(0xFFFF)
#endif
_CRTIMP wchar_t *_cgetws(wchar_t *_Buffer);
_CRTIMP wint_t __cdecl _getwch(void);
_CRTIMP wint_t __cdecl _getwche(void);
@ -551,10 +527,6 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
#ifndef _WSTDIO_DEFINED
#define _WSTDIO_DEFINED
#ifndef WEOF
#define WEOF (wint_t)(0xFFFF)
#endif
#ifdef _POSIX_
_CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode);
#else
@ -621,9 +593,6 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
_CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args);
_CRTIMP int __cdecl __swprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,...);
_CRTIMP int __cdecl __vswprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,va_list _Args);
#ifndef RC_INVOKED
#include <vadefs.h>
#endif
#ifdef _CRT_NON_CONFORMING_SWPRINTFS
#ifndef __cplusplus
@ -871,5 +840,5 @@ __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_T
#pragma pack(pop)
#include <sec_api/wchar_s.h>
//#include <sec_api/wchar_s.h>
#endif