From cae9985747a688f092ea85f1f46dc815f99e58a5 Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Sat, 23 Dec 2023 16:33:38 +1300 Subject: [PATCH] change BSD ifndefs to __OpenBSD__ and remove unnecessary ifdefs I'm not sure if any operating system other than OpenBSD has strlcpy/strlcat. May need to use a configure script for this later on. --- lcl.c | 2 +- lfs.c | 4 +--- lprocess.c | 6 +++--- util.c | 2 +- util.h | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lcl.c b/lcl.c index a09e700..b3c49dc 100644 --- a/lcl.c +++ b/lcl.c @@ -9,7 +9,7 @@ #include #include #include -#ifdef BSD +#ifdef __OpenBSD__ # include #endif diff --git a/lfs.c b/lfs.c index 3591fb6..06a32fb 100644 --- a/lfs.c +++ b/lfs.c @@ -12,9 +12,7 @@ #include #include #include -#ifdef BSD -# include -#endif +#include #include #include diff --git a/lprocess.c b/lprocess.c index e5b7d03..f862bb9 100644 --- a/lprocess.c +++ b/lprocess.c @@ -1,6 +1,6 @@ /*** - * Processes, signals, and - * signal handlers. + * Processes, signals, and signal handlers. + * * @module process */ @@ -9,7 +9,7 @@ #include #include #include -#ifdef BSD +#ifdef __OpenBSD__ # include #endif diff --git a/util.c b/util.c index 68eb7c9..6226684 100644 --- a/util.c +++ b/util.c @@ -37,7 +37,7 @@ lfailm(lua_State *L, const char *mesg) * lib/libc/string/strlcat.c and * lib/libc/string/strlcpy.c respectively */ -#ifndef BSD +#ifndef __OpenBSD__ /* * Appends src to string dst of size dsize (unlike strncat, dsize is the diff --git a/util.h b/util.h index 7e6e020..5465f26 100644 --- a/util.h +++ b/util.h @@ -2,13 +2,13 @@ #define _UTIL_H_ -#include +#include #include int lfail(lua_State *); int lfailm(lua_State *, const char *); -#ifndef BSD +#ifndef __OpenBSD__ size_t strlcat(char *, const char *, size_t); size_t strlcpy(char *, const char *, size_t); #endif