- moved win32 hacks into osdep.h so that gui/control.cc (which doesn't

include bochs.h) can use them too
This commit is contained in:
Bryce Denney 2001-06-22 13:35:48 +00:00
parent 071bcf34c9
commit ef61b33db2
2 changed files with 19 additions and 16 deletions

View File

@ -61,22 +61,6 @@ extern "C" {
#endif
}
// Hacks for win32: always return regular file.
#ifdef WIN32
#ifndef __MINGW32__
# define S_ISREG(st_mode) 1
# define S_ISCHR(st_mode) 0
// VCPP includes also are missing these
# define off_t long
# define ssize_t int
// win32 has snprintf though with different name.
#define snprintf _snprintf
#endif
#endif
#include "config.h" /* generated by configure script from config.h.in */
#include "osdep.h" /* platform dependent includes and defines */
#include "debug/debug.h"

View File

@ -39,6 +39,24 @@
extern "C" {
#endif /* __cplusplus */
//////////////////////////////////////////////////////////////////////
// Hacks for win32, but exclude MINGW32 because it doesn't need them.
//////////////////////////////////////////////////////////////////////
#ifdef WIN32
#ifndef __MINGW32__
// always return regular file.
# define S_ISREG(st_mode) 1
# define S_ISCHR(st_mode) 0
// VCPP includes also are missing these
# define off_t long
# define ssize_t int
// win32 has snprintf though with different name.
#define snprintf _snprintf
#endif /* ifnndef __MINGW32__ */
#endif /* WIN32 */
//////////////////////////////////////////////////////////////////////
// Missing library functions.
// These should work on any platform that needs them.
@ -52,6 +70,7 @@ extern "C" {
// that it might be cleaner to conditionally disable the function call!
//////////////////////////////////////////////////////////////////////
#if !BX_HAVE_SNPRINTF
#define snprintf bx_snprintf
extern int bx_snprintf (char *s, size_t maxlen, const char *format, ...);