From b2f39d7ddd2305462e1a1bc2886045a26d4d7fc1 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Sun, 6 Nov 2005 18:22:49 +0000 Subject: [PATCH] use system memcpy and memset --- code/macosx/macosx_common.c | 2 ++ code/qcommon/common.c | 7 ++----- code/qcommon/md4.c | 5 +++++ code/qcommon/q_shared.h | 5 +++++ code/unix/linux_common.c | 2 ++ 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/code/macosx/macosx_common.c b/code/macosx/macosx_common.c index ab7d3bea..1d42d907 100644 --- a/code/macosx/macosx_common.c +++ b/code/macosx/macosx_common.c @@ -1,3 +1,4 @@ +#if 0 // not used anymore /* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. @@ -29,3 +30,4 @@ void Com_Memcpy (void* dest, const void* src, const size_t count) { void Com_Memset (void* dest, const int val, const size_t count) { memset(dest, val, count); } +#endif diff --git a/code/qcommon/common.c b/code/qcommon/common.c index a2f76b98..3b582fcb 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -2824,9 +2824,7 @@ void Com_Shutdown (void) { } -#if !( defined __GNUC__ ) // GNU versions in linux_common.c -#if !id386 - +#if I_WANT_A_CUSTOM_MEMCPY && !defined(_WIN32) void Com_Memcpy (void* dest, const void* src, const size_t count) { memcpy(dest, src, count); @@ -2837,7 +2835,7 @@ void Com_Memset (void* dest, const int val, const size_t count) memset(dest, val, count); } -#else +#elif I_WANT_A_CUSTOM_MEMCPY && defined(_WIN32) typedef enum { @@ -3136,7 +3134,6 @@ skipClamp: } } #endif -#endif //------------------------------------------------------------------------ diff --git a/code/qcommon/md4.c b/code/qcommon/md4.c index 323798b0..24b79610 100644 --- a/code/qcommon/md4.c +++ b/code/qcommon/md4.c @@ -38,8 +38,13 @@ void MD4Init (MD4_CTX *); void MD4Update (MD4_CTX *, const unsigned char *, unsigned int); void MD4Final (unsigned char [16], MD4_CTX *); +#if I_WANT_A_CUSTOM_MEMCPY void Com_Memset (void* dest, const int val, const size_t count); void Com_Memcpy (void* dest, const void* src, const size_t count); +#else +#define Com_Memset memset +#define Com_Memcpy memcpy +#endif /* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm */ /* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index 20f15e18..45bd0460 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -237,8 +237,13 @@ void Snd_Memset (void* dest, const int val, const size_t count); #define Snd_Memset Com_Memset #endif +#if I_WANT_A_CUSTOM_MEMCPY void Com_Memset (void* dest, const int val, const size_t count); void Com_Memcpy (void* dest, const void* src, const size_t count); +#else +#define Com_Memset memset +#define Com_Memcpy memcpy +#endif #define CIN_system 1 #define CIN_loop 2 diff --git a/code/unix/linux_common.c b/code/unix/linux_common.c index 0321ac2f..ab1eafa6 100644 --- a/code/unix/linux_common.c +++ b/code/unix/linux_common.c @@ -1,3 +1,4 @@ +#if 0 // not used anymore /* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. @@ -342,3 +343,4 @@ void Com_Prefetch (const void *s, const unsigned int bytes, e_prefetch type) } #endif +#endif