From f5ad737d73ed18b95ce63f1d8e933a89a26653e9 Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <azat@libevent.org>
Date: Sat, 9 Jul 2022 14:22:38 +0300
Subject: [PATCH] Add -Wundef for cmake and fix EVENT__SIZEOF_TIME_T usage

Note, autotools already supports it.
---
 CMakeLists.txt       | 1 +
 event-config.h.cmake | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ee0df2f7..9237252c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -295,6 +295,7 @@ if (${GNUC})
 
     list(APPEND __FLAGS
          -Wall -Wextra -Wno-unused-parameter -Wstrict-aliasing -Wstrict-prototypes
+         -Wundef
 
          -fno-strict-aliasing # gcc 2.9.5+
          -Wmissing-prototypes
diff --git a/event-config.h.cmake b/event-config.h.cmake
index 9fff34877..4a6267017 100644
--- a/event-config.h.cmake
+++ b/event-config.h.cmake
@@ -485,6 +485,9 @@
 /* The size of 'void *', as computer by sizeof */
 #define EVENT__SIZEOF_VOID_P @EVENT__SIZEOF_VOID_P@
 
+/* The size of 'time_t', as computer by sizeof */
+#define EVENT__SIZEOF_TIME_T @EVENT__SIZEOF_TIME_T@
+
 /* Define to `__inline__' or `__inline' if that's what the C compiler
    calls it, or to nothing if 'inline' is not supported under any name.  */
 #ifndef __cplusplus
