From 09a8a39940ad02951b62454a5d222af669fef694 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Tue, 20 Nov 2018 11:24:55 +0000 Subject: [PATCH] util: use standard name for strchrnul() Signed-off-by: Eric Engestrom Reviewed-by: Eric Anholt Reviewed-by: Emil Velikov Reviewed-by: Eric Anholt --- src/amd/common/ac_debug.c | 2 +- src/gallium/auxiliary/pipe-loader/pipe_loader.c | 2 +- src/util/u_string.h | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/amd/common/ac_debug.c b/src/amd/common/ac_debug.c index 1632106..36a01fd 100644 --- a/src/amd/common/ac_debug.c +++ b/src/amd/common/ac_debug.c @@ -542,7 +542,7 @@ static void format_ib_output(FILE *f, char *out) if (indent) print_spaces(f, indent); - char *end = util_strchrnul(out, '\n'); + char *end = strchrnul(out, '\n'); fwrite(out, end - out, 1, f); fputc('\n', f); /* always end with a new line */ if (!*end) diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c b/src/gallium/auxiliary/pipe-loader/pipe_loader.c index 29718a2..b435486 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c @@ -138,7 +138,7 @@ pipe_loader_find_module(const char *driver_name, int len, ret; for (next = library_paths; *next; library_paths = next + 1) { - next = util_strchrnul(library_paths, ':'); + next = strchrnul(library_paths, ':'); len = next - library_paths; if (len) diff --git a/src/util/u_string.h b/src/util/u_string.h index 751ae90..b43c426 100644 --- a/src/util/u_string.h +++ b/src/util/u_string.h @@ -50,12 +50,9 @@ extern "C" { #endif -#ifdef _GNU_SOURCE - -#define util_strchrnul strchrnul - -#else +#ifndef _GNU_SOURCE +#define strchrnul util_strchrnul static inline char * util_strchrnul(const char *s, char c) { -- 2.7.4