Changeset 4d10fc8 in mainline


Ignore:
Timestamp:
2011-06-07T17:16:38Z (13 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
acc3f82c
Parents:
2fc5072
Message:

Add LIBPOSIX_INTERNAL macro to avoid unnecessary undefines

Location:
uspace/lib/posix
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/stdlib.c

    r2fc5072 r4d10fc8  
    3333 */
    3434
    35 #undef qsort
     35#define LIBPOSIX_INTERNAL
    3636
    37 #undef getenv
    38 
    39 #undef realpath
     37#include "stdlib.h"
    4038
    4139/**
  • uspace/lib/posix/stdlib.h

    r2fc5072 r4d10fc8  
    5656extern char *posix_realpath(const char *restrict name, char *restrict resolved);
    5757
     58#ifndef LIBPOSIX_INTERNAL
     59        #define qsort posix_qsort
     60        #define getenv posix_getenv
     61        #define realpath posix_realpath
     62#endif
     63
    5864#endif  // POSIX_STDLIB_H_
    5965
  • uspace/lib/posix/string.c

    r2fc5072 r4d10fc8  
    3434 */
    3535
     36#define LIBPOSIX_INTERNAL
     37
    3638#include "string.h"
    3739
     
    3941
    4042#include <str_error.h>
    41 
    42 #undef strcpy
    43 #undef strncpy
    44 #undef strcat
    45 #undef strncat
    46 #undef mempcpy
    47 #undef strdup
    48 
    49 #undef memcmp
    50 #undef strcmp
    51 #undef strncmp
    52 #undef strcasecmp
    53 #undef strncasecmp
    54 
    55 #undef memchr
    56 #undef rawmemchr
    57 #undef strchr
    58 #undef strrchr
    59 #undef strpbrk
    60 #undef strcspn
    61 #undef strspn
    62 #undef strstr
    63 
    64 #undef strcoll
    65 #undef strxfrm
    66 
    67 #undef strerror
    68 
    69 #undef strlen
    7043
    7144/**
  • uspace/lib/posix/string.h

    r2fc5072 r4d10fc8  
    7979extern size_t posix_strlen(const char *s);
    8080
    81 #define strcpy posix_strcpy
    82 #define strncpy posix_strncpy
    83 #define strcat posix_strcat
    84 #define strncat posix_strncat
    85 #define mempcpy posix_mempcpy
    86 #define strdup posix_strdup
     81#ifndef LIBPOSIX_INTERNAL
     82        #define strcpy posix_strcpy
     83        #define strncpy posix_strncpy
     84        #define strcat posix_strcat
     85        #define strncat posix_strncat
     86        #define mempcpy posix_mempcpy
     87        #define strdup posix_strdup
    8788
    88 #define memcmp posix_memcmp
    89 #define strcmp posix_strcmp
    90 #define strncmp posix_strncmp
    91 #define strcasecmp posix_strcasecmp
    92 #define strncasecmp posix_strncasecmp
     89        #define memcmp posix_memcmp
     90        #define strcmp posix_strcmp
     91        #define strncmp posix_strncmp
     92        #define strcasecmp posix_strcasecmp
     93        #define strncasecmp posix_strncasecmp
    9394
    94 #define memchr posix_memchr
    95 #define rawmemchr posix_rawmemchr
    96 #define strchr posix_strchr
    97 #define strrchr posix_strrchr
    98 #define strpbrk posix_strpbrk
    99 #define strcspn posix_strcspn
    100 #define strspn posix_strspn
    101 #define strstr posix_strstr
     95        #define memchr posix_memchr
     96        #define rawmemchr posix_rawmemchr
     97        #define strchr posix_strchr
     98        #define strrchr posix_strrchr
     99        #define strpbrk posix_strpbrk
     100        #define strcspn posix_strcspn
     101        #define strspn posix_strspn
     102        #define strstr posix_strstr
    102103
    103 #define strcoll posix_strcoll
    104 #define strxfrm posix_strxfrm
     104        #define strcoll posix_strcoll
     105        #define strxfrm posix_strxfrm
    105106
    106 #define strerror posix_strerror
     107        #define strerror posix_strerror
    107108
    108 #define strlen posix_strlen
     109        #define strlen posix_strlen
     110#endif
    109111
    110112#endif  // POSIX_STRING_H_
  • uspace/lib/posix/time.c

    r2fc5072 r4d10fc8  
    3434 */
    3535
     36#define LIBPOSIX_INTERNAL
     37
    3638#include "time.h"
    37 
    38 #undef tm
    39 
    40 #undef localtime
    41 
    42 #undef asctime
    43 #undef ctime
    44 #undef strftime
    4539
    4640/**
  • uspace/lib/posix/time.h

    r2fc5072 r4d10fc8  
    6363extern size_t posix_strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct posix_tm *restrict tm);
    6464
    65 #define tm posix_tm
     65#ifndef LIBPOSIX_INTERNAL
     66        #define tm posix_tm
    6667
    67 #define localtime posix_localtime
     68        #define localtime posix_localtime
    6869
    69 #define asctime posix_asctime
    70 #define ctime posix_ctime
    71 #define strftime posix_strftime
     70        #define asctime posix_asctime
     71        #define ctime posix_ctime
     72        #define strftime posix_strftime
     73#endif
    7274
    7375#endif  // POSIX_TIME_H_
Note: See TracChangeset for help on using the changeset viewer.