[ros-diffs] [sginsberg] 43168: Fix one of the most awesome "_MSC_VER means compiling with Microsoft's header set" assumptions, revision 30728. Instead of breaking linking for user mode CRT to hide header incompatibilities we now use a less exciting solution; do not include the incompatible headers when implementing the affected functions -- abs.c and labs.c don't need anything at all, and strset.c only needs size_t, so define it there.
sginsberg at svn.reactos.org
sginsberg at svn.reactos.org
Sat Sep 26 17:42:35 CEST 2009
Author: sginsberg
Date: Sat Sep 26 17:42:34 2009
New Revision: 43168
URL: http://svn.reactos.org/svn/reactos?rev=43168&view=rev
Log:
Fix one of the most awesome "_MSC_VER means compiling with Microsoft's header set" assumptions, revision 30728. Instead of breaking linking for user mode CRT to hide header incompatibilities we now use a less exciting solution; do not include the incompatible headers when implementing the affected functions -- abs.c and labs.c don't need anything at all, and strset.c only needs size_t, so define it there.
Modified:
trunk/reactos/lib/sdk/crt/math/abs.c
trunk/reactos/lib/sdk/crt/math/labs.c
trunk/reactos/lib/sdk/crt/string/strset.c
Modified: trunk/reactos/lib/sdk/crt/math/abs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/math/abs.c?rev=43168&r1=43167&r2=43168&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/math/abs.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/math/abs.c [iso-8859-1] Sat Sep 26 17:42:34 2009
@@ -1,13 +1,10 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <stdlib.h>
/*
* @implemented
*/
-#ifndef _MSC_VER
int
abs(int j)
{
return j<0 ? -j : j;
}
-#endif
Modified: trunk/reactos/lib/sdk/crt/math/labs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/math/labs.c?rev=43168&r1=43167&r2=43168&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/math/labs.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/math/labs.c [iso-8859-1] Sat Sep 26 17:42:34 2009
@@ -1,13 +1,10 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
-#include <precomp.h>
/*
* @implemented
*/
-#ifndef _MSC_VER
long
labs(long j)
{
return j<0 ? -j : j;
}
-#endif
Modified: trunk/reactos/lib/sdk/crt/string/strset.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/strset.c?rev=43168&r1=43167&r2=43168&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/string/strset.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/string/strset.c [iso-8859-1] Sat Sep 26 17:42:34 2009
@@ -8,7 +8,15 @@
* 25/11/05: Added license header
*/
-#include <precomp.h>
+#if defined(__GNUC__)
+#define __int64 long long
+#endif
+
+#ifdef _WIN64
+typedef unsigned __int64 size_t;
+#else
+typedef unsigned int size_t;
+#endif
/*
* @implemented
@@ -30,7 +38,6 @@
/*
* @implemented
*/
-#ifndef _MSC_VER
char* _strset(char* szToFill, int szFill)
{
char *t = szToFill;
@@ -42,4 +49,3 @@
}
return t;
}
-#endif
More information about the Ros-diffs
mailing list