From 4c53cb03cc2be849ab6fb37b733311dfc139bd54 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 26 Sep 2009 15:42:34 +0000 Subject: [PATCH] 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. svn path=/trunk/; revision=43168 --- reactos/lib/sdk/crt/math/abs.c | 3 --- reactos/lib/sdk/crt/math/labs.c | 3 --- reactos/lib/sdk/crt/string/strset.c | 12 +++++++++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reactos/lib/sdk/crt/math/abs.c b/reactos/lib/sdk/crt/math/abs.c index a95798b8de4..a18f19b2666 100644 --- a/reactos/lib/sdk/crt/math/abs.c +++ b/reactos/lib/sdk/crt/math/abs.c @@ -1,13 +1,10 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include /* * @implemented */ -#ifndef _MSC_VER int abs(int j) { return j<0 ? -j : j; } -#endif diff --git a/reactos/lib/sdk/crt/math/labs.c b/reactos/lib/sdk/crt/math/labs.c index e19c211c99b..b4fc33ec0a0 100644 --- a/reactos/lib/sdk/crt/math/labs.c +++ b/reactos/lib/sdk/crt/math/labs.c @@ -1,13 +1,10 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include /* * @implemented */ -#ifndef _MSC_VER long labs(long j) { return j<0 ? -j : j; } -#endif diff --git a/reactos/lib/sdk/crt/string/strset.c b/reactos/lib/sdk/crt/string/strset.c index db44dd26f8d..e6c422d4f9c 100644 --- a/reactos/lib/sdk/crt/string/strset.c +++ b/reactos/lib/sdk/crt/string/strset.c @@ -8,7 +8,15 @@ * 25/11/05: Added license header */ -#include +#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 @@ char* _strnset(char* szToFill, int szFill, size_t sizeMaxFill) /* * @implemented */ -#ifndef _MSC_VER char* _strset(char* szToFill, int szFill) { char *t = szToFill; @@ -42,4 +49,3 @@ char* _strset(char* szToFill, int szFill) } return t; } -#endif