This breaks compiling on Mac OS X... I haven't been able to build since this patch, because now it tries to include windows.h.
On 27-Jul-08, at 12:39 PM, hpoussin@svn.reactos.org wrote:
Author: hpoussin Date: Sun Jul 27 14:39:05 2008 New Revision: 34856
URL: http://svn.reactos.org/svn/reactos?rev=34856&view=rev Log: Revert r34848 and r34850, and replace them by a real fix (hinted by Colin Finck)
Modified: trunk/reactos/Makefile trunk/reactos/tools/sysreg/namedpipe_reader.cpp trunk/reactos/tools/sysreg/os_support.cpp trunk/reactos/tools/sysreg/os_support.h trunk/reactos/tools/sysreg/rosboot_test.cpp trunk/reactos/tools/sysreg/rosboot_test.h trunk/reactos/tools/sysreg/user_types.h
Modified: trunk/reactos/Makefile URL: http://svn.reactos.org/svn/reactos/trunk/reactos/Makefile?rev=34856&r1=3... = = = = = = = = ====================================================================== --- trunk/reactos/Makefile [iso-8859-1] (original) +++ trunk/reactos/Makefile [iso-8859-1] Sun Jul 27 14:39:05 2008 @@ -182,8 +182,8 @@ 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
Modified: trunk/reactos/tools/sysreg/namedpipe_reader.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/namedpipe_read... = = = = = = = = ====================================================================== --- trunk/reactos/tools/sysreg/namedpipe_reader.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/sysreg/namedpipe_reader.cpp [iso-8859-1] Sun Jul 27 14:39:05 2008 @@ -14,7 +14,7 @@ { #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 @@ 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 @@ 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 @@ bool NamedPipeReader::readPipe(char * buffer, int bufferlength, long & bytesread) {
-#ifdef __LINUX__ +#ifdef __linux__ long cbRead = read(h_Pipe, buffer, (bufferlength-1) * sizeof(char));
Modified: trunk/reactos/tools/sysreg/os_support.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/os_support.cpp... = = = = = = = = ====================================================================== --- trunk/reactos/tools/sysreg/os_support.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/sysreg/os_support.cpp [iso-8859-1] Sun Jul 27 14:39:05 2008 @@ -38,7 +38,7 @@ } }
-#ifdef __LINUX__ +#ifdef __linux__ if (s_Entries.size()) { long secs = s_Entries[i]->tm.tv_sec - tm.tv_sec; @@ -54,7 +54,7 @@ void OsSupport::cancelAlarms() {
-#ifndef __LINUX__ +#ifndef __linux__ if (s_hThread) { TerminateThread(s_hThread, 0); @@ -73,7 +73,7 @@ }
-#ifndef __LINUX__ +#ifndef __linux__
HANDLE OsSupport::s_hThread = 0; static HANDLE hTimer;Modified: trunk/reactos/tools/sysreg/os_support.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/os_support.h?r... = = = = = = = = ====================================================================== --- trunk/reactos/tools/sysreg/os_support.h [iso-8859-1] (original) +++ trunk/reactos/tools/sysreg/os_support.h [iso-8859-1] Sun Jul 27 14:39:05 2008 @@ -10,7 +10,7 @@
- PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox
tugraz at) */
-#ifndef __LINUX__ +#ifndef __linux__ #include <windows.h> #else #include <unistd.h> @@ -140,7 +140,7 @@ OsSupport() {}
-#ifdef __LINUX__ +#ifdef __linux__ static struct sigaction s_sact; #else static HANDLE s_hThread;
Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.c... = = = = = = = = ====================================================================== --- trunk/reactos/tools/sysreg/rosboot_test.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/sysreg/rosboot_test.cpp [iso-8859-1] Sun Jul 27 14:39:05 2008 @@ -46,7 +46,7 @@ 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 @@ img = "output-i386";
EnvironmentVariable::getValue("ROS_OUTPUT", img);-#ifdef __LINUX__ +#ifdef __linux__ img += "/ros.hd"; #else img += "\ros.hd"; @@ -159,7 +159,7 @@ }
-#ifdef __LINUX__ +#ifdef __linux__ qemuimgdir += "/qemu-img";
#else @@ -176,7 +176,7 @@ const char * options[] = {NULL, "create", "-f", -#ifdef __LINUX__ +#ifdef __linux__ "raw", #else "vmdk", @@ -241,7 +241,7 @@ { 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 @@ m_MaxMem = "64"; }
-#ifdef __LINUX__ +#ifdef __linux__
if (mktemp(pipename)) {@@ -332,7 +332,7 @@ 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 @@ { pipe = pipe.substr(0, pos); } -#ifdef __LINUX__ +#ifdef __linux__ m_Src = pipe; #else m_Src = "\\.\pipe\" + pipe.substr(0, pos); @@ -577,7 +577,7 @@ return false; } } -#ifdef __LINUX__ +#ifdef __linux__ if (mkfifo(m_Src.c_str(), 400)) { /* @@ -802,7 +802,7 @@ 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 @@ } #endif OsSupport::cancelAlarms(); -#ifdef __LINUX__ +#ifdef __linux__ // OsSupport::setAlarm (m_MaxTime, m_Pid); // OsSupport::setAlarm(m_MaxTime, getpid()); #else
Modified: trunk/reactos/tools/sysreg/rosboot_test.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.h... = = = = = = = = ====================================================================== --- trunk/reactos/tools/sysreg/rosboot_test.h [iso-8859-1] (original) +++ trunk/reactos/tools/sysreg/rosboot_test.h [iso-8859-1] Sun Jul 27 14:39:05 2008 @@ -30,12 +30,12 @@ #include <cstdlib> #include <cstring> #include <ctime> -#ifndef __LINUX__ +#ifndef __linux__ #include <io.h> #include <errno.h> #endif
-#ifdef __LINUX__ +#ifdef __linux__ #include <unistd.h> #include <sys/types.h> #if defined(__FreeBSD__) || defined(__APPLE__)
Modified: trunk/reactos/tools/sysreg/user_types.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/user_types.h?r... = = = = = = = = ====================================================================== --- trunk/reactos/tools/sysreg/user_types.h [iso-8859-1] (original) +++ trunk/reactos/tools/sysreg/user_types.h [iso-8859-1] Sun Jul 27 14:39:05 2008 @@ -13,7 +13,7 @@ #include <string> #include <iostream>
-#ifndef __LINUX__ +#ifndef __linux__ #define popen _popen #define pclose _pclose #endif
Best regards, Alex Ionescu
Alex Ionescu wrote:
This breaks compiling on Mac OS X... I haven't been able to build since this patch, because now it tries to include windows.h.
What happens if you try to replace all occurrences of "__linux__" by "unix" (without any underscores) ? I found this define on my Linux boxes as well, but can't test if it also exists for other Unices like Mac OS X.
Best regards,
Colin
I'll try and report.
But honestly, wouldn't it be better to replace all the #ifdef linux by #ifndef windows?
On 28-Jul-08, at 1:02 AM, Colin Finck wrote:
Alex Ionescu wrote:
This breaks compiling on Mac OS X... I haven't been able to build since this patch, because now it tries to include windows.h.
What happens if you try to replace all occurrences of "__linux__" by "unix" (without any underscores) ? I found this define on my Linux boxes as well, but can't test if it also exists for other Unices like Mac OS X.
Best regards,
Colin
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Best regards, Alex Ionescu
Alex Ionescu wrote:
But honestly, wouldn't it be better to replace all the #ifdef linux by #ifndef windows?
Indeed, that would be better ;-) Fixed in r34891.
Best regards,
Colin