From: Jacob Keller <jacob.e.keller@intel.com>
To: git@vger.kernel.org
Cc: Jonas 'Sortie' Termansen <sortie@maxsi.org>,
Jacob Keller <jacob.e.keller@intel.com>
Subject: [PATCH 7/9] autoconf: Check for struct itimerspec
Date: Fri, 29 Aug 2014 09:42:39 -0700 [thread overview]
Message-ID: <1409330561-11806-7-git-send-email-jacob.e.keller@intel.com> (raw)
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 itimerspec if they only rely on
config.mak.uname. They will need to set NO_STRUCT_ITIMERSPEC manually.
Signed-off-by: Jonas 'Sortie' Termansen <sortie@maxsi.org>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
Makefile | 5 +++++
config.mak.uname | 3 +++
configure.ac | 7 +++++++
git-compat-util.h | 7 +++++++
4 files changed, 22 insertions(+)
diff --git a/Makefile b/Makefile
index b76dc4385952..66329e4b372b 100644
--- a/Makefile
+++ b/Makefile
@@ -191,6 +191,8 @@ all::
# Define NO_STRUCT_ITIMERVAL if you don't have struct itimerval
# This also implies NO_SETITIMER
#
+# Define NO_STRUCT_ITIMERSPEC if you don't have struct itimerspec
+#
# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
# generally faster on your platform than accessing the working directory.
#
@@ -1357,6 +1359,9 @@ ifdef NO_STRUCT_ITIMERVAL
COMPAT_CFLAGS += -DNO_STRUCT_ITIMERVAL
NO_SETITIMER = YesPlease
endif
+ifdef NO_STRUCT_ITIMERSPEC
+ COMPAT_CFLAGS += -DNO_STRUCT_ITIMERSPEC
+endif
ifdef NO_SETITIMER
COMPAT_CFLAGS += -DNO_SETITIMER
endif
diff --git a/config.mak.uname b/config.mak.uname
index 892afc573c28..f0d93ef868a7 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -98,6 +98,7 @@ ifeq ($(uname_S),Darwin)
NO_MEMMEM = YesPlease
USE_ST_TIMESPEC = YesPlease
HAVE_DEV_TTY = YesPlease
+ NO_STRUCT_ITIMERSPEC = UnfortunatelyYes
COMPAT_OBJS += compat/precompose_utf8.o
BASIC_CFLAGS += -DPRECOMPOSE_UNICODE
endif
@@ -358,6 +359,7 @@ ifeq ($(uname_S),Windows)
NO_TIMER_T = UnfortunatelyYes
NO_STRUCT_TIMESPEC = UnfortunatelyYes
NO_STRUCT_SIGEVENT = UnfortunatelyYes
+ NO_STRUCT_ITIMERSPEC = UnfortunatelyYes
CC = compat/vcbuild/scripts/clink.pl
AR = compat/vcbuild/scripts/lib.pl
@@ -510,6 +512,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_TIMER_T = UnfortunatelyYes
NO_STRUCT_TIMESPEC = UnfortunatelyYes
NO_STRUCT_SIGEVENT = UnfortunatelyYes
+ NO_STRUCT_ITIMERSPEC = 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 103b40704b6f..954f9ddb03c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -769,6 +769,13 @@ AC_CHECK_TYPES([struct timespec],
[#include <sys/time.h>])
GIT_CONF_SUBST([NO_STRUCT_TIMESPEC])
#
+# Define NO_STRUCT_ITIMERSPEC if you don't have struct itimerspec.
+AC_CHECK_TYPES([struct itimerspec],
+[NO_STRUCT_ITIMERSPEC=],
+[NO_STRUCT_ITIMERSPEC=UnfortunatelyYes],
+[#include <time.h>])
+GIT_CONF_SUBST([NO_STRUCT_ITIMERSPEC])
+#
# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
AC_CHECK_MEMBER(struct dirent.d_ino,
[NO_D_INO_IN_DIRENT=],
diff --git a/git-compat-util.h b/git-compat-util.h
index 195eda6f1575..4ef17df86b0e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -217,6 +217,13 @@ struct itimerval {
};
#endif
+#ifdef NO_STRUCT_ITIMERSPEC
+struct itimerspec {
+ struct timespec it_interval;
+ struct timespec it_value;
+};
+#endif
+
#ifdef NO_SETITIMER
#define setitimer(which,value,ovalue)
#endif
--
2.0.1.475.g9b8d714
next prev parent reply other threads:[~2014-08-29 16:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 16:42 [PATCH 1/9] git-compat-util.h: Add missing semicolon after struct itimerval Jacob Keller
2014-08-29 16:42 ` [PATCH 2/9] autoconf: Check for " Jacob Keller
2014-08-29 16:42 ` [PATCH 3/9] autoconf: Check for setitimer Jacob Keller
2014-08-29 16:42 ` [PATCH 4/9] autoconf: Check for timer_t Jacob Keller
2014-08-29 18:20 ` Jonas 'Sortie' Termansen
2014-08-29 16:42 ` [PATCH 5/9] autoconf: Check for struct timespec Jacob Keller
2014-08-29 16:42 ` [PATCH 6/9] autoconf: Check for struct sigevent Jacob Keller
2014-08-29 16:42 ` Jacob Keller [this message]
2014-08-29 16:42 ` [PATCH 8/9] autoconf: Check for timer_settime Jacob Keller
2014-08-29 17:26 ` Johannes Sixt
2014-08-29 17:40 ` Keller, Jacob E
2014-09-10 15:33 ` Karsten Blees
2014-09-10 21:08 ` Junio C Hamano
2014-09-10 21:13 ` Keller, Jacob E
2014-08-29 16:42 ` [PATCH 9/9] Use timer_settime for new platforms Jacob Keller
2014-08-29 18:02 ` Junio C Hamano
2014-08-29 18:09 ` Keller, Jacob E
2014-08-29 18:12 ` Junio C Hamano
2014-08-29 16:48 ` [PATCH 1/9] git-compat-util.h: Add missing semicolon after struct itimerval Keller, Jacob E
2014-08-29 18:54 ` Jonas 'Sortie' Termansen
2014-08-29 19:07 ` Junio C Hamano
2014-08-29 19:43 ` Jonas 'Sortie' Termansen
2014-09-03 0:17 ` Keller, Jacob E
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409330561-11806-7-git-send-email-jacob.e.keller@intel.com \
--to=jacob.e.keller@intel.com \
--cc=git@vger.kernel.org \
--cc=sortie@maxsi.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).