1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

use #if instead of #ifdef to simplify the config file

This commit is contained in:
Stefan Lankes 2017-03-07 23:08:59 +01:00
parent e288b9ee4b
commit 5c1c002d0f

View file

@ -10,7 +10,7 @@
#include <hermit/string.h>
#ifndef HAVE_ARCH_MEMCPY
#if !HAVE_ARCH_MEMCPY
void *memcpy(void *dest, const void *src, size_t count)
{
size_t i;
@ -25,7 +25,7 @@ void *memcpy(void *dest, const void *src, size_t count)
}
#endif
#ifndef HAVE_ARCH_MEMSET
#if !HAVE_ARCH_MEMSET
void *memset(void *dest, int val, size_t count)
{
size_t i;
@ -40,7 +40,7 @@ void *memset(void *dest, int val, size_t count)
}
#endif
#ifndef HAVE_ARCH_MEMCMP
#if !HAVE_ARCH_MEMCMP
int memcmp(const void *s1, const void *s2, size_t n)
{
if (n != 0) {
@ -56,7 +56,7 @@ int memcmp(const void *s1, const void *s2, size_t n)
}
#endif
#ifndef HAVE_ARCH_STRLEN
#if !HAVE_ARCH_STRLEN
size_t strlen(const char *str)
{
size_t len = 0;
@ -71,7 +71,7 @@ size_t strlen(const char *str)
}
#endif
#ifndef HAVE_ARCH_STRNCPY
#if !HAVE_ARCH_STRNCPY
char* strncpy(char *dest, const char *src, size_t n)
{
size_t i;
@ -90,7 +90,7 @@ char* strncpy(char *dest, const char *src, size_t n)
}
#endif
#ifndef HAVE_ARCH_STRCPY
#if !HAVE_ARCH_STRCPY
char* strcpy(char *dest, const char *src)
{
size_t i;
@ -106,7 +106,7 @@ char* strcpy(char *dest, const char *src)
}
#endif
#ifndef HAVE_ARCH_STRCMP
#if !HAVE_ARCH_STRCMP
int strcmp(const char *s1, const char *s2)
{
while (*s1 != '\0' && *s1 == *s2) {
@ -118,7 +118,7 @@ int strcmp(const char *s1, const char *s2)
}
#endif
#ifndef HAVE_ARCH_STRNCMP
#if !HAVE_ARCH_STRNCMP
int strncmp(const char *s1, const char *s2, size_t n)
{
if (BUILTIN_EXPECT(n == 0, 0))