Match up interrogate standard typedefs better with gcc/msvc standard typedefs

This commit is contained in:
rdb 2015-09-30 16:07:37 +02:00
parent 036adff924
commit 30a26bc530
3 changed files with 26 additions and 19 deletions

View File

@ -48,7 +48,6 @@ using namespace std;
// this maps to public. // this maps to public.
#define PUBLISHED __published #define PUBLISHED __published
typedef int streamsize;
typedef int ios_openmode; typedef int ios_openmode;
typedef int ios_fmtflags; typedef int ios_fmtflags;
typedef int ios_iostate; typedef int ios_iostate;
@ -100,7 +99,7 @@ typedef basic_string<wchar_t> wstring;
#ifndef HAVE_STREAMSIZE #ifndef HAVE_STREAMSIZE
// Some C++ libraries (Irix) don't define this. // Some C++ libraries (Irix) don't define this.
typedef int streamsize; typedef long streamsize;
#endif #endif
#ifndef HAVE_IOS_TYPEDEFS #ifndef HAVE_IOS_TYPEDEFS

View File

@ -20,6 +20,19 @@
#ifndef IOSTREAM_H #ifndef IOSTREAM_H
#define IOSTREAM_H #define IOSTREAM_H
#include <stdtypedefs.h>
#ifdef _WIN64
typedef long long streamoff;
typedef long long streamsize;
#elif defined(_WIN32)
typedef long streamoff;
typedef int streamsize;
#else
typedef long long streamoff;
typedef ptrdiff_t streamsize;
#endif
// We don't care (much) about the actual definition of the various // We don't care (much) about the actual definition of the various
// iostream classes, but we do need to know the classnames that are // iostream classes, but we do need to know the classnames that are
// available. // available.
@ -50,14 +63,6 @@ protected:
class ios : public ios_base { class ios : public ios_base {
__published: __published:
typedef long fmtflags; typedef long fmtflags;
#if defined(_WIN64) || !defined(_WIN32)
typedef unsigned long long streampos;
typedef long long streamoff;
#else
// 32-bit Windows uses 32-bit stream offsets.
typedef unsigned long streampos;
typedef long streamoff;
#endif
bool good() const; bool good() const;
bool eof() const; bool eof() const;
@ -114,6 +119,4 @@ extern istream cin;
extern ostream cout; extern ostream cout;
extern ostream cerr; extern ostream cerr;
typedef long streamoff;
#endif #endif

View File

@ -19,25 +19,30 @@
#ifndef STDTYPEDEFS_H #ifndef STDTYPEDEFS_H
#define STDTYPEDEFS_H #define STDTYPEDEFS_H
#ifndef __APPLE__
typedef unsigned long size_t;
typedef long ssize_t;
typedef int off_t; typedef int off_t;
typedef unsigned int time_t; typedef long time_t;
typedef int clock_t; typedef long clock_t;
struct FILE; struct FILE;
namespace std { namespace std {
} }
#endif
typedef int ptrdiff_t;
typedef unsigned int uint; typedef unsigned int uint;
typedef unsigned long ulong; typedef unsigned long ulong;
typedef unsigned short ushort; typedef unsigned short ushort;
typedef unsigned char uchar; typedef unsigned char uchar;
#ifdef _WIN64
typedef unsigned long long size_t;
typedef long long ssize_t;
typedef long long ptrdiff_t;
#else
typedef unsigned long size_t;
typedef long ssize_t;
typedef long ptrdiff_t;
#endif
#ifdef __cplusplus #ifdef __cplusplus
#define NULL 0L #define NULL 0L
#else #else