MinGW fixes
This was SVN commit r1936.
This commit is contained in:
parent
e6c8cef293
commit
91d330d040
@ -22,13 +22,18 @@
|
|||||||
#error "including win.h without _WIN32 defined"
|
#error "including win.h without _WIN32 defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
// C99
|
// provide C99 *snprintf functions if compiler doesn't already
|
||||||
|
// (MinGW does, VC7.1 doesn't).
|
||||||
|
#ifndef HAVE_C99
|
||||||
# define snprintf _snprintf
|
# define snprintf _snprintf
|
||||||
# define swprintf _snwprintf
|
# define swprintf _snwprintf
|
||||||
# define vsnprintf _vsnprintf
|
# define vsnprintf _vsnprintf
|
||||||
# define vsnwprintf _vsnwprintf
|
# define vsnwprintf _vsnwprintf
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stddef.h> // wchar_t
|
#include <stddef.h> // wchar_t
|
||||||
|
|
||||||
|
@ -133,6 +133,9 @@ typedef struct _MEMORYSTATUSEX
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// MinGW headers are already fixed; only change on VC
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
#ifndef NTSTATUS
|
#ifndef NTSTATUS
|
||||||
#define NTSTATUS long
|
#define NTSTATUS long
|
||||||
#endif
|
#endif
|
||||||
@ -229,16 +232,6 @@ typedef struct {
|
|||||||
|
|
||||||
#endif // WINVER < 0x500
|
#endif // WINVER < 0x500
|
||||||
|
|
||||||
typedef struct _PROCESSOR_POWER_INFORMATION
|
|
||||||
{
|
|
||||||
ULONG Number;
|
|
||||||
ULONG MaxMhz;
|
|
||||||
ULONG CurrentMhz;
|
|
||||||
ULONG MhzLimit;
|
|
||||||
ULONG MaxIdleState;
|
|
||||||
ULONG CurrentIdleState;
|
|
||||||
} PROCESSOR_POWER_INFORMATION, *PPROCESSOR_POWER_INFORMATION;
|
|
||||||
|
|
||||||
typedef struct _SYSTEM_POWER_INFORMATION
|
typedef struct _SYSTEM_POWER_INFORMATION
|
||||||
{
|
{
|
||||||
ULONG MaxIdlenessAllowed;
|
ULONG MaxIdlenessAllowed;
|
||||||
@ -251,6 +244,19 @@ typedef struct _SYSTEM_POWER_INFORMATION
|
|||||||
#define PO_TZ_INVALID_MODE 0 // The system does not support CPU throttling,
|
#define PO_TZ_INVALID_MODE 0 // The system does not support CPU throttling,
|
||||||
// or there is no thermal zone defined [..]
|
// or there is no thermal zone defined [..]
|
||||||
|
|
||||||
|
#endif // #ifdef _MSC_VER
|
||||||
|
|
||||||
|
// neither VC7.1 nor MinGW define this
|
||||||
|
typedef struct _PROCESSOR_POWER_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG Number;
|
||||||
|
ULONG MaxMhz;
|
||||||
|
ULONG CurrentMhz;
|
||||||
|
ULONG MhzLimit;
|
||||||
|
ULONG MaxIdleState;
|
||||||
|
ULONG CurrentIdleState;
|
||||||
|
} PROCESSOR_POWER_INFORMATION, *PPROCESSOR_POWER_INFORMATION;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
@ -122,7 +122,10 @@ EWOULDBLOCK // Operation would block (may be the same value as EAGAIN]).
|
|||||||
// sys/stat.h
|
// sys/stat.h
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// already defined by MinGW
|
||||||
|
#ifdef _MSC_VER
|
||||||
typedef unsigned int mode_t;
|
typedef unsigned int mode_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
// VC libc includes stat, but it's quite slow.
|
// VC libc includes stat, but it's quite slow.
|
||||||
// we implement our own, but use the CRT struct definition.
|
// we implement our own, but use the CRT struct definition.
|
||||||
|
@ -5,7 +5,12 @@
|
|||||||
|
|
||||||
typedef char int8_t;
|
typedef char int8_t;
|
||||||
typedef short int16_t;
|
typedef short int16_t;
|
||||||
|
|
||||||
|
// already defined by MinGW
|
||||||
|
#ifdef _MSC_VER
|
||||||
typedef int int32_t;
|
typedef int int32_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(__INTEL_COMPILER) || defined(__LCC__)
|
#if defined(_MSC_VER) || defined(__INTEL_COMPILER) || defined(__LCC__)
|
||||||
typedef __int64 int64_t;
|
typedef __int64 int64_t;
|
||||||
#elif defined(__GNUC__) || defined(__MWERKS__) || defined(__SUNPRO_C) || defined(__DMC__)
|
#elif defined(__GNUC__) || defined(__MWERKS__) || defined(__SUNPRO_C) || defined(__DMC__)
|
||||||
|
Loading…
Reference in New Issue
Block a user