aboutsummaryrefslogtreecommitdiff
path: root/include/compat/string.h
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2023-11-18 10:53:09 +0100
committerTheo Buehler <tb@openbsd.org>2023-12-11 17:14:07 +0100
commit0a446e81ed77c20aa87563d45ef0ef8f5fa283d8 (patch)
treefbd4104f19c292d5f65f33a2094efc10c2e58716 /include/compat/string.h
parent2e88c74329938b5af441736645e795289660aa38 (diff)
downloadportable-0a446e81ed77c20aa87563d45ef0ef8f5fa283d8.tar.gz
portable-0a446e81ed77c20aa87563d45ef0ef8f5fa283d8.tar.bz2
portable-0a446e81ed77c20aa87563d45ef0ef8f5fa283d8.zip
Prefix some compat symbols with libressl_
See #928. This isn't a full fix, but should remove much of the friction already.
Diffstat (limited to 'include/compat/string.h')
-rw-r--r--include/compat/string.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/compat/string.h b/include/compat/string.h
index 4bf7519..6a82793 100644
--- a/include/compat/string.h
+++ b/include/compat/string.h
@@ -27,43 +27,54 @@
27#endif 27#endif
28 28
29#ifndef HAVE_STRCASECMP 29#ifndef HAVE_STRCASECMP
30#define strcasecmp libressl_strcasecmp
30int strcasecmp(const char *s1, const char *s2); 31int strcasecmp(const char *s1, const char *s2);
32#define strncasecmp libressl_strncasecmp
31int strncasecmp(const char *s1, const char *s2, size_t len); 33int strncasecmp(const char *s1, const char *s2, size_t len);
32#endif 34#endif
33 35
34#ifndef HAVE_STRLCPY 36#ifndef HAVE_STRLCPY
37#define strlcpy libressl_strlcpy
35size_t strlcpy(char *dst, const char *src, size_t siz); 38size_t strlcpy(char *dst, const char *src, size_t siz);
36#endif 39#endif
37 40
38#ifndef HAVE_STRLCAT 41#ifndef HAVE_STRLCAT
42#define strlcat libressl_strlcat
39size_t strlcat(char *dst, const char *src, size_t siz); 43size_t strlcat(char *dst, const char *src, size_t siz);
40#endif 44#endif
41 45
42#ifndef HAVE_STRNDUP 46#ifndef HAVE_STRNDUP
47#define strndup libressl_strndup
43char * strndup(const char *str, size_t maxlen); 48char * strndup(const char *str, size_t maxlen);
44/* the only user of strnlen is strndup, so only build it if needed */ 49/* the only user of strnlen is strndup, so only build it if needed */
45#ifndef HAVE_STRNLEN 50#ifndef HAVE_STRNLEN
51#define strnlen libressl_strnlen
46size_t strnlen(const char *str, size_t maxlen); 52size_t strnlen(const char *str, size_t maxlen);
47#endif 53#endif
48#endif 54#endif
49 55
50#ifndef HAVE_STRSEP 56#ifndef HAVE_STRSEP
57#define strsep libressl_strsep
51char *strsep(char **stringp, const char *delim); 58char *strsep(char **stringp, const char *delim);
52#endif 59#endif
53 60
54#ifndef HAVE_EXPLICIT_BZERO 61#ifndef HAVE_EXPLICIT_BZERO
62#define explicit_bzero libressl_explicit_bzero
55void explicit_bzero(void *, size_t); 63void explicit_bzero(void *, size_t);
56#endif 64#endif
57 65
58#ifndef HAVE_TIMINGSAFE_BCMP 66#ifndef HAVE_TIMINGSAFE_BCMP
67#define timingsafe_bcmp libressl_timingsafe_bcmp
59int timingsafe_bcmp(const void *b1, const void *b2, size_t n); 68int timingsafe_bcmp(const void *b1, const void *b2, size_t n);
60#endif 69#endif
61 70
62#ifndef HAVE_TIMINGSAFE_MEMCMP 71#ifndef HAVE_TIMINGSAFE_MEMCMP
72#define timingsafe_memcmp libressl_timingsafe_memcmp
63int timingsafe_memcmp(const void *b1, const void *b2, size_t len); 73int timingsafe_memcmp(const void *b1, const void *b2, size_t len);
64#endif 74#endif
65 75
66#ifndef HAVE_MEMMEM 76#ifndef HAVE_MEMMEM
77#define memmem libressl_memmem
67void * memmem(const void *big, size_t big_len, const void *little, 78void * memmem(const void *big, size_t big_len, const void *little,
68 size_t little_len); 79 size_t little_len);
69#endif 80#endif