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
This commit is contained in:
Stefan Ginsberg 2009-09-26 15:42:34 +00:00
parent 7e11f6d4bc
commit 4c53cb03cc
3 changed files with 9 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -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 @@ 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