summaryrefslogtreecommitdiffhomepage
path: root/tunnel/tools/ndk-compat/compat.c
blob: c5ce85ec1c7f3050eae0a45934f0b48cef15f6a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* SPDX-License-Identifier: BSD
 *
 * Copyright © 2017-2023 WireGuard LLC. All Rights Reserved.
 *
 */

#define FILE_IS_EMPTY

#if defined(__ANDROID_MIN_SDK_VERSION__) && __ANDROID_MIN_SDK_VERSION__ < 24
#undef FILE_IS_EMPTY
#include <string.h>

char *strchrnul(const char *s, int c)
{
        char *x = strchr(s, c);
        if (!x)
                return (char *)s + strlen(s);
        return x;
}
#endif

#ifdef FILE_IS_EMPTY
#undef FILE_IS_EMPTY
static char ____x __attribute__((unused));
#endif