1 #ifndef _STRCMP_NAMING_H_
2 #define _STRCMP_NAMING_H_
3 
4 /* Utility macros.  */
5 #define STRCMP_SUFFIX(x, y) x##y
6 #define STRCMP_NAME(x, y) STRCMP_SUFFIX (x, y)
7 
8 /* Setup base of all definitions.  */
9 #define STRNCASECMP_BASE __strncasecmp
10 #define STRCASECMP_BASE __strcasecmp
11 #define WCSCMP_BASE __wcscmp
12 
13 #if defined USE_MULTIARCH && IS_IN (libc)
14 # define WCSNCMP_BASE __wcsncmp
15 # define STRNCMP_BASE __strncmp
16 # define STRCMP_BASE __strcmp
17 
18 #else
19 /* Covers IS_IN (rtld) or non-multiarch build.  */
20 # define WCSNCMP_BASE wcsncmp
21 # define STRNCMP_BASE strncmp
22 # define STRCMP_BASE strcmp
23 
24 # undef STRCMP_ISA
25 # define STRCMP_ISA
26 #endif
27 
28 #if IS_IN (rtld) || defined USE_MULTIARCH
29 # define ISA_HIDDEN_JUMPTARGET(...) __VA_ARGS__
30 #else
31 # define ISA_HIDDEN_JUMPTARGET(...) HIDDEN_JUMPTARGET (__VA_ARGS__)
32 #endif
33 
34 /* Get correct symbol for OVERFLOW_STRCMP, STRCMP, and
35    STRCASECMP.  */
36 #if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
37 
38 # if defined USE_AS_WCSCMP || defined USE_AS_WCSNCMP
39 #  define OVERFLOW_STRCMP_SYM WCSCMP_BASE
40 #  define STRCMP_SYM WCSNCMP_BASE
41 # elif defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
42 #  define OVERFLOW_STRCMP_SYM STRCMP_NAME (STRCASECMP_BASE, _l)
43 #  define STRCMP_SYM STRCMP_NAME (STRNCASECMP_BASE, _l)
44 # else
45 #  define OVERFLOW_STRCMP_SYM STRCMP_BASE
46 #  define STRCMP_SYM STRNCMP_BASE
47 # endif
48 
49 # define STRCASECMP_SYM STRNCASECMP_BASE
50 # define OVERFLOW_STRCMP \
51     ISA_HIDDEN_JUMPTARGET (STRCMP_NAME (OVERFLOW_STRCMP_SYM, STRCMP_ISA))
52 #else
53 # ifdef USE_AS_WCSCMP
54 #  define STRCMP_SYM WCSCMP_BASE
55 # elif defined USE_AS_STRCASECMP_L
56 #  define STRCMP_SYM STRCMP_NAME (STRCASECMP_BASE, _l)
57 # else
58 #  define STRCMP_SYM STRCMP_BASE
59 # endif
60 
61 # define STRCASECMP_SYM STRCASECMP_BASE
62 #endif
63 
64 #define STRCASECMP_L_NONASCII STRCMP_NAME (STRCASECMP_SYM, _l_nonascii)
65 #define STRCASECMP STRCMP_NAME (STRCASECMP_SYM, STRCMP_ISA)
66 #define STRCMP STRCMP_NAME (STRCMP_SYM, STRCMP_ISA)
67 
68 #endif
69