git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 6/9] autoconf: Check for struct sigevent

From
Jacob Keller <jacob.e.keller@intel.com>
Date
Aug 29, 2014, 16:42 UTC
Message-ID
<1409330561-11806-6-git-send-email-jacob.e.keller@intel.com>
In-Reply-To
<1409330561-11806-1-git-send-email-jacob.e.keller@intel.com>
From: Jonas 'Sortie' Termansen <sortie@maxsi.org>
This type will be used in a following commit.

This type was not previously used by git. This can cause trouble for people on systems without struct sigevent if they only rely on config.mak.uname. They will need to set NO_STRUCT_SIGEVENT manually.

Signed-off-by: Jonas 'Sortie' Termansen <sortie@maxsi.org>
---
 Makefile          |  5 +++++
 config.mak.uname  |  2 ++
 configure.ac      |  7 +++++++
 git-compat-util.h | 12 ++++++++++++
 4 files changed, 26 insertions(+)
diff --git a/Makefile b/Makefile
index 0dd3e35327c9..b76dc4385952 100644
--- a/Makefile
+++ b/Makefile
@@ -186,6 +186,8 @@ all::
 #
 # Define NO_STRUCT_TIMESPEC if you don't have struct timespec
 #
+# Define NO_STRUCT_SIGEVENT if you don't have struct sigevent
+#
 # Define NO_STRUCT_ITIMERVAL if you don't have struct itimerval
 # This also implies NO_SETITIMER
 #
@@ -1348,6 +1350,9 @@ endif
 ifdef NO_STRUCT_TIMESPEC
 	COMPAT_CFLAGS += -DNO_STRUCT_TIMESPEC
 endif
+ifdef NO_STRUCT_SIGEVENT
+	COMPAT_CFLAGS += -DNO_STRUCT_SIGEVENT
+endif
 ifdef NO_STRUCT_ITIMERVAL
 	COMPAT_CFLAGS += -DNO_STRUCT_ITIMERVAL
 	NO_SETITIMER = YesPlease
diff --git a/config.mak.uname b/config.mak.uname
index 812179159be2..892afc573c28 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -357,6 +357,7 @@ ifeq ($(uname_S),Windows)
 	NO_D_INO_IN_DIRENT = YesPlease
 	NO_TIMER_T = UnfortunatelyYes
 	NO_STRUCT_TIMESPEC = UnfortunatelyYes
+	NO_STRUCT_SIGEVENT = UnfortunatelyYes
 
 	CC = compat/vcbuild/scripts/clink.pl
 	AR = compat/vcbuild/scripts/lib.pl
@@ -508,6 +509,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
 	NO_D_INO_IN_DIRENT = YesPlease
 	NO_TIMER_T = UnfortunatelyYes
 	NO_STRUCT_TIMESPEC = UnfortunatelyYes
+	NO_STRUCT_SIGEVENT = UnfortunatelyYes
 	COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -D_USE_32BIT_TIME_T -DNOGDI -Icompat -Icompat/win32
 	COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
 	COMPAT_OBJS += compat/mingw.o compat/winansi.o \
diff --git a/configure.ac b/configure.ac
index bed8fe9c9590..103b40704b6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -776,6 +776,13 @@ AC_CHECK_MEMBER(struct dirent.d_ino,
 [#include <dirent.h>])
 GIT_CONF_SUBST([NO_D_INO_IN_DIRENT])
 #
+# Define NO_STRUCT_SIGEVENT if you don't have struct sigevent.
+AC_CHECK_TYPES([struct sigevent],
+[NO_STRUCT_SIGEVENT=],
+[NO_STRUCT_SIGEVENT=UnfortunatelyYes],
+[#include <signal.h>])
+GIT_CONF_SUBST([NO_STRUCT_SIGEVENT])
+#
 # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
 # d_type in struct dirent (latest Cygwin -- will be fixed soonish).
 AC_CHECK_MEMBER(struct dirent.d_type,
diff --git a/git-compat-util.h b/git-compat-util.h
index e9e7e5451a99..195eda6f1575 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -198,6 +198,18 @@ struct timespec {
 };
 #endif
 
+#ifndef SIGEV_SIGNAL
+#define SIGEV_SIGNAL 1 /* dummy */
+#endif
+
+#ifdef NO_STRUCT_SIGEVENT
+struct sigevent /* dummy */
+{
+	int sigev_notify;
+	int sigev_signo;
+};
+#endif
+
 #ifdef NO_STRUCT_ITIMERVAL
 struct itimerval {
 	struct timeval it_interval;
-- 
2.0.1.475.g9b8d714
Previous: Jacob KellerNext: Jacob Keller
Message 7 of 23 in “git-compat-util.h: Add missing semicolon after struct itimerval”
  1. 1/9 git-compat-util.h: Add missing semicolon after struct itimervalJacob Keller, Aug 29, 2014
  2. 2/9 autoconf: Check for struct itimervalJacob Keller, Aug 29, 2014
  3. 3/9 autoconf: Check for setitimerJacob Keller, Aug 29, 2014
  4. 4/9 autoconf: Check for timer_tJacob Keller, Aug 29, 2014
  5. Jonas 'Sortie' TermansenAug 29, 2014
  6. 5/9 autoconf: Check for struct timespecJacob Keller, Aug 29, 2014
  7. 6/9 autoconf: Check for struct sigeventJacob Keller, Aug 29, 2014
  8. 7/9 autoconf: Check for struct itimerspecJacob Keller, Aug 29, 2014
  9. 8/9 autoconf: Check for timer_settimeJacob Keller, Aug 29, 2014
  10. Johannes SixtAug 29, 2014
  11. Keller, Jacob EAug 29, 2014
  12. Karsten BleesSep 10, 2014
  13. Junio C HamanoSep 10, 2014
  14. Keller, Jacob ESep 10, 2014
  15. 9/9 Use timer_settime for new platformsJacob Keller, Aug 29, 2014
  16. Junio C HamanoAug 29, 2014
  17. Keller, Jacob EAug 29, 2014
  18. Junio C HamanoAug 29, 2014
  19. Keller, Jacob EAug 29, 2014
  20. Jonas 'Sortie' TermansenAug 29, 2014
  21. Junio C HamanoAug 29, 2014
  22. Jonas 'Sortie' TermansenAug 29, 2014
  23. Keller, Jacob ESep 3, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.