diff --git a/src/doomtype.h b/src/doomtype.h
index 617fd4d4772a11b5af88deb428df602744c561ea..58565a2326d614634820de6bae3d114feac83ab9 100644
--- a/src/doomtype.h
+++ b/src/doomtype.h
@@ -113,6 +113,11 @@ int endswith (const char *base, const char *tag);
 #define HAVE_DOSSTR_FUNCS
 #endif
 
+// glibc 2.38: added strlcpy and strlcat to _DEFAULT_SOURCE
+#if defined (__APPLE__) || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38)
+#define HAVE_STRLCPY
+#endif
+
 #ifndef HAVE_DOSSTR_FUNCS
 int strupr(char *n); // from dosstr.c
 int strlwr(char *n); // from dosstr.c
@@ -120,7 +125,7 @@ int strlwr(char *n); // from dosstr.c
 
 #include <stddef.h> // for size_t
 
-#ifndef __APPLE__
+#ifndef HAVE_STRLCPY
 size_t strlcat(char *dst, const char *src, size_t siz);
 size_t strlcpy(char *dst, const char *src, size_t siz);
 #endif
diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c
index b2215f634a189d1bce50083ef8394ad63b434e85..590d7d142a7a536678bfb96d3891c78264a19fba 100644
--- a/src/sdl/i_video.c
+++ b/src/sdl/i_video.c
@@ -1593,7 +1593,6 @@ boolean VID_CheckRenderer(void)
 			else if (vid.glstate == VID_GL_LIBRARY_ERROR)
 				rendererchanged = false;
 		}
-		else
 #endif
 
 		if (!contextcreated)
diff --git a/src/string.c b/src/string.c
index dd3080a979ca3ccffa811f27ee408bef7540bb26..cbc8ea5826f81bb1bd8a54a15d9684123ed890f4 100644
--- a/src/string.c
+++ b/src/string.c
@@ -15,7 +15,7 @@
 #include <string.h>
 #include "doomdef.h"
 
-#if !defined (__APPLE__)
+#ifndef HAVE_STRLCPY
 
 // Like the OpenBSD version, but it doesn't check for src not being a valid
 // C string.