mesa/src/util/strndup.h
Yonggang Luo bd915eeb96 util: Fixes gcc warning: declaration of 'strndup' shadows a built-in function [-Wshadow]
../../src/util/strndup.h:37:1: warning: declaration of 'strndup' shadows a built-in function [-Wshadow]
   37 | strndup(const char *str, size_t max)
      | ^~~~~~~

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37289>
2025-09-13 08:23:07 +00:00

27 lines
348 B
C

/*
* Copyright (c) 2015 Intel Corporation
* SPDX-License-Identifier: MIT
*/
#ifndef STRNDUP_H
#define STRNDUP_H
#if defined(_WIN32)
#include <stdlib.h> // size_t
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
char *
strndup(const char *str, size_t max);
#ifdef __cplusplus
}
#endif
#endif /* _WIN32 */
#endif /* STRNDUP_H */