Make MSVC a bit happy with sources
This commit is contained in:
parent
9d4ae516d5
commit
c283d9e260
@ -73,9 +73,11 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
|
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
|
||||||
#error You definetly need to upgrade your gcc at least up to 2.8.x
|
#error You definetly need to upgrade your gcc at least up to 2.8.x
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
@ -34,7 +34,11 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#ifdef _POSIX_SOURCE
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#else
|
||||||
|
#include <cstdlib>
|
||||||
|
#endif
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -162,30 +162,28 @@ int g_init_os(int flags) {
|
|||||||
#endif
|
#endif
|
||||||
// Due to Win9x doesn't have proper locale support we should rebuild
|
// Due to Win9x doesn't have proper locale support we should rebuild
|
||||||
// tolower/toupper tables
|
// tolower/toupper tables
|
||||||
char src[2], dst[2];
|
char src[2], dst[2], tst[2];
|
||||||
for(i = 0; i < 128; i++) {
|
for(i = 0; i < 32; i++) {
|
||||||
tu[i] = (toupper)(i);
|
tu[i] = (toupper)(i);
|
||||||
tl[i] = (tolower)(i);
|
tl[i] = (tolower)(i);
|
||||||
}
|
}
|
||||||
for(i = 128; i < 256; i++) {
|
for(i = 32; i < 256; i++) {
|
||||||
*dst = i; dst[1] = 0;
|
|
||||||
OemToChar(dst, src);
|
|
||||||
LCMapString(LOCALE_SYSTEM_DEFAULT, LCMAP_UPPERCASE, src, 1, dst, 2);
|
|
||||||
CharToOem(dst, src);
|
|
||||||
tu[i] = (*src & 0xff);
|
|
||||||
*dst = i; dst[1] = 0;
|
|
||||||
OemToChar(dst, src);
|
|
||||||
LCMapString(LOCALE_SYSTEM_DEFAULT, LCMAP_LOWERCASE, src, 1, dst, 2);
|
|
||||||
CharToOem(dst, src);
|
|
||||||
tl[i] = (*src & 0xff);
|
|
||||||
}
|
|
||||||
for(i = 128; i < 256; i++) {
|
|
||||||
if((tu[tl[i]] != i) && (tl[tu[i]] != i))
|
|
||||||
tu[i] = tl[i] = i;
|
tu[i] = tl[i] = i;
|
||||||
if(tu[tl[i]] != tu[i])
|
*dst = i; dst[1] = 0;
|
||||||
tu[i] = i;
|
OemToChar(dst, src);
|
||||||
if(tl[tu[i]] != tl[i])
|
CharToOem(src, tst);
|
||||||
tl[i] = i;
|
if(*dst != *tst)
|
||||||
|
continue;
|
||||||
|
if(LCMapString(LOCALE_SYSTEM_DEFAULT, LCMAP_UPPERCASE, src, 1, dst, 2)) {
|
||||||
|
CharToOem(dst, src);
|
||||||
|
tu[i] = *src;
|
||||||
|
}
|
||||||
|
*dst = i; dst[1] = 0;
|
||||||
|
OemToChar(dst, src);
|
||||||
|
if(LCMapString(LOCALE_SYSTEM_DEFAULT, LCMAP_LOWERCASE, src, 1, dst, 2)) {
|
||||||
|
CharToOem(dst, src);
|
||||||
|
tl[i] = *src;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
#define HAVE_DIRENT_H 1
|
#define HAVE_DIRENT_H 1
|
||||||
#define STDC_HEADERS 1
|
#define STDC_HEADERS 1
|
||||||
|
#ifdef _POSIX_SOURCE
|
||||||
#define HAVE_UNISTD_H 1
|
#define HAVE_UNISTD_H 1
|
||||||
|
#endif
|
||||||
#define HAVE_STRING_H 1
|
#define HAVE_STRING_H 1
|
||||||
#define HAVE_MEMORY_H 1
|
#define HAVE_MEMORY_H 1
|
||||||
#define HAVE_STRCOLL 1
|
#define HAVE_STRCOLL 1
|
||||||
|
@ -55,7 +55,9 @@
|
|||||||
#define HAVE_FCNTL_H 1
|
#define HAVE_FCNTL_H 1
|
||||||
|
|
||||||
/* Define if you have the <io.h> header file. */
|
/* Define if you have the <io.h> header file. */
|
||||||
#undef HAVE_IO_H
|
#ifndef _POSIX_SOURCE
|
||||||
|
#define HAVE_IO_H
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define if you have the <malloc.h> header file. */
|
/* Define if you have the <malloc.h> header file. */
|
||||||
#undef HAVE_MALLOC_H
|
#undef HAVE_MALLOC_H
|
||||||
@ -70,7 +72,9 @@
|
|||||||
#define HAVE_SYS_TIME_H 1
|
#define HAVE_SYS_TIME_H 1
|
||||||
|
|
||||||
/* Define if you have the <unistd.h> header file. */
|
/* Define if you have the <unistd.h> header file. */
|
||||||
|
#ifdef _POSIX_SOURCE
|
||||||
#define HAVE_UNISTD_H 1
|
#define HAVE_UNISTD_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define if you have the <varargs.h> header file. */
|
/* Define if you have the <varargs.h> header file. */
|
||||||
/* #undef HAVE_VARARGS_H */
|
/* #undef HAVE_VARARGS_H */
|
||||||
|
@ -38,6 +38,9 @@
|
|||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_IO_H
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ERRNO_H
|
#ifdef HAVE_ERRNO_H
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -45,6 +45,9 @@
|
|||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_IO_H
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ERRNO_H
|
#ifdef HAVE_ERRNO_H
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -42,6 +42,9 @@
|
|||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_IO_H
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_MEMORY_H
|
#ifdef HAVE_MEMORY_H
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user