From 246c0ca9d0d776f0a60ddee856e67aa0a697cad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 27 Jul 2008 19:39:05 +0000 Subject: [PATCH] Revert r34848 and r34850, and replace them by a real fix (hinted by Colin Finck) svn path=/trunk/; revision=34856 --- reactos/Makefile | 4 ++-- reactos/tools/sysreg/namedpipe_reader.cpp | 8 ++++---- reactos/tools/sysreg/os_support.cpp | 6 +++--- reactos/tools/sysreg/os_support.h | 4 ++-- reactos/tools/sysreg/rosboot_test.cpp | 22 +++++++++++----------- reactos/tools/sysreg/rosboot_test.h | 4 ++-- reactos/tools/sysreg/user_types.h | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/reactos/Makefile b/reactos/Makefile index a378f48c7f0..dc823d59275 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -182,8 +182,8 @@ HOST=mingw32-windows endif else HOST=mingw32-linux -HOST_CFLAGS+=-fshort-wchar -D__LINUX__ -HOST_CPPFLAGS+=-fshort-wchar -D__LINUX__ +HOST_CFLAGS+=-fshort-wchar +HOST_CPPFLAGS+=-fshort-wchar endif endif diff --git a/reactos/tools/sysreg/namedpipe_reader.cpp b/reactos/tools/sysreg/namedpipe_reader.cpp index a9e5bc07c0f..24385ef7f2c 100644 --- a/reactos/tools/sysreg/namedpipe_reader.cpp +++ b/reactos/tools/sysreg/namedpipe_reader.cpp @@ -14,7 +14,7 @@ namespace System_ { #define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#ifdef __LINUX__ +#ifdef __linux__ const char * NamedPipeReader::s_LineBreak = "\x0A\0"; #else const char * NamedPipeReader::s_LineBreak = "\x0D\x0A\0"; @@ -46,7 +46,7 @@ namespace System_ cerr << "NamedPipeReader::openPipe> pipe already open" << endl; return false; } -#ifndef __LINUX__ +#ifndef __linux__ h_Pipe = CreateFile(PipeCmd.c_str(), GENERIC_WRITE | GENERIC_READ, 0, @@ -105,7 +105,7 @@ namespace System_ cerr << "NamedPipeReader::closePipe> pipe is not open" << endl; return false; } -#ifdef __LINUX__ +#ifdef __linux__ close(h_Pipe); #else DisconnectNamedPipe(h_Pipe); @@ -274,7 +274,7 @@ namespace System_ bool NamedPipeReader::readPipe(char * buffer, int bufferlength, long & bytesread) { -#ifdef __LINUX__ +#ifdef __linux__ long cbRead = read(h_Pipe, buffer, (bufferlength-1) * sizeof(char)); diff --git a/reactos/tools/sysreg/os_support.cpp b/reactos/tools/sysreg/os_support.cpp index cca073be27d..9953df7e3b4 100644 --- a/reactos/tools/sysreg/os_support.cpp +++ b/reactos/tools/sysreg/os_support.cpp @@ -38,7 +38,7 @@ namespace System_ } } -#ifdef __LINUX__ +#ifdef __linux__ if (s_Entries.size()) { long secs = s_Entries[i]->tm.tv_sec - tm.tv_sec; @@ -54,7 +54,7 @@ namespace System_ void OsSupport::cancelAlarms() { -#ifndef __LINUX__ +#ifndef __linux__ if (s_hThread) { TerminateThread(s_hThread, 0); @@ -73,7 +73,7 @@ namespace System_ } -#ifndef __LINUX__ +#ifndef __linux__ HANDLE OsSupport::s_hThread = 0; static HANDLE hTimer; diff --git a/reactos/tools/sysreg/os_support.h b/reactos/tools/sysreg/os_support.h index c67ffc6ad01..805256bd4fd 100644 --- a/reactos/tools/sysreg/os_support.h +++ b/reactos/tools/sysreg/os_support.h @@ -10,7 +10,7 @@ * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) */ -#ifndef __LINUX__ +#ifndef __linux__ #include #else #include @@ -140,7 +140,7 @@ namespace System_ OsSupport() {} -#ifdef __LINUX__ +#ifdef __linux__ static struct sigaction s_sact; #else static HANDLE s_hThread; diff --git a/reactos/tools/sysreg/rosboot_test.cpp b/reactos/tools/sysreg/rosboot_test.cpp index 5000e9092cf..45a91837451 100644 --- a/reactos/tools/sysreg/rosboot_test.cpp +++ b/reactos/tools/sysreg/rosboot_test.cpp @@ -46,7 +46,7 @@ namespace Sysreg_ string RosBootTest::XEN_CONFIG_FILE = "XEN_CONFIG_FILE"; string RosBootTest::XEN_CONFIG_NAME = "XEN_CONFIG_NAME"; -#ifdef __LINUX__ +#ifdef __linux__ string RosBootTest::ROS_EMU_PATH = "ROS_EMU_PATH_LIN"; #else string RosBootTest::ROS_EMU_PATH = "ROS_EMU_PATH_WIN"; @@ -117,7 +117,7 @@ namespace Sysreg_ img = "output-i386"; EnvironmentVariable::getValue("ROS_OUTPUT", img); -#ifdef __LINUX__ +#ifdef __linux__ img += "/ros.hd"; #else img += "\\ros.hd"; @@ -159,7 +159,7 @@ namespace Sysreg_ } -#ifdef __LINUX__ +#ifdef __linux__ qemuimgdir += "/qemu-img"; #else @@ -176,7 +176,7 @@ namespace Sysreg_ const char * options[] = {NULL, "create", "-f", -#ifdef __LINUX__ +#ifdef __linux__ "raw", #else "vmdk", @@ -241,7 +241,7 @@ namespace Sysreg_ { string::size_type pos; -#ifdef __LINUX__ +#ifdef __linux__ pos = m_EmuPath.find_last_of("/"); #else pos = m_EmuPath.find_last_of("\\"); @@ -266,7 +266,7 @@ namespace Sysreg_ m_MaxMem = "64"; } -#ifdef __LINUX__ +#ifdef __linux__ if (mktemp(pipename)) { @@ -332,7 +332,7 @@ namespace Sysreg_ return false; } -#ifdef __LINUX__ +#ifdef __linux__ /* on linux we need get pid in order to be able * to terminate the emulator in case of errors * on windows we can get pid as return of CreateProcess @@ -369,7 +369,7 @@ namespace Sysreg_ { pipe = pipe.substr(0, pos); } -#ifdef __LINUX__ +#ifdef __linux__ m_Src = pipe; #else m_Src = "\\\\.\\pipe\\" + pipe.substr(0, pos); @@ -577,7 +577,7 @@ namespace Sysreg_ return false; } } -#ifdef __LINUX__ +#ifdef __linux__ if (mkfifo(m_Src.c_str(), 400)) { /* @@ -802,7 +802,7 @@ namespace Sysreg_ cleanup(conf_parser); return false; } -#ifdef __LINUX__ +#ifdef __linux__ /* * For linux systems we can only * check if the emulator runs by @@ -832,7 +832,7 @@ namespace Sysreg_ } #endif OsSupport::cancelAlarms(); -#ifdef __LINUX__ +#ifdef __linux__ // OsSupport::setAlarm (m_MaxTime, m_Pid); // OsSupport::setAlarm(m_MaxTime, getpid()); #else diff --git a/reactos/tools/sysreg/rosboot_test.h b/reactos/tools/sysreg/rosboot_test.h index 548c9e6e982..2457f1a0659 100644 --- a/reactos/tools/sysreg/rosboot_test.h +++ b/reactos/tools/sysreg/rosboot_test.h @@ -30,12 +30,12 @@ #include #include #include -#ifndef __LINUX__ +#ifndef __linux__ #include #include #endif -#ifdef __LINUX__ +#ifdef __linux__ #include #include #if defined(__FreeBSD__) || defined(__APPLE__) diff --git a/reactos/tools/sysreg/user_types.h b/reactos/tools/sysreg/user_types.h index c5f763c5a26..a13543cdc32 100644 --- a/reactos/tools/sysreg/user_types.h +++ b/reactos/tools/sysreg/user_types.h @@ -13,7 +13,7 @@ #include #include -#ifndef __LINUX__ +#ifndef __linux__ #define popen _popen #define pclose _pclose #endif