Hintsdb: fix build config phase for sqlite
[exim.git] / src / src / os.c
index 5c52c6d4d44d509a4f223069f36d100506f2c36d..dce5fca3df10f61d00949082a8bebd5bc3da23a3 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) The Exim Maintainers 2021 - 2023 */
+/* Copyright (c) The Exim Maintainers 2021 - 2024 */
 /* Copyright (c) University of Cambridge 1995 - 2018 */
 /* See the file NOTICE for conditions of use and distribution. */
 /* SPDX-License-Identifier: GPL-2.0-or-later */
@@ -12,7 +12,8 @@
 # include <stdio.h>
 # include <time.h>
 #else
-# define DEBUG(x) if (debug_selector & (x))
+# define IS_DEBUG(x) (debug_selector & (x))
+# define DEBUG(x) if (IS_DEBUG(x))
 #endif
 
 #ifndef CS
@@ -877,9 +878,7 @@ os_getcwd(unsigned char * buffer, size_t size)
 return US  getcwd(CS buffer, size);
 }
 #else
-#ifndef PATH_MAX
-# define PATH_MAX 4096
-#endif
+# include "path_max.h"
 unsigned char *
 os_getcwd(unsigned char * buffer, size_t size)
 {
@@ -893,6 +892,21 @@ return buffer ? buffer : realloc(b, strlen(b) + 1);
 #endif
 
 /* ----------------------------------------------------------------------- */
+/***********************************************************
+*             strchrnul()                                  *
+***********************************************************/
+
+#if !defined(EXIM_HAVE_STRCHRNUL)
+char *
+strchrnul(const char * s, int c)
+{
+while (*s != c && *s) s++;
+return CS s;
+}
+#endif
+
+
+/* ----------------------------------------------------------------------- */