summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e88a135)
raw | patch | inline | side by side (parent: e88a135)
author | Gary V. Vaughan <git@mlists.thewrittenword.com> | |
Fri, 14 May 2010 09:31:43 +0000 (09:31 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 1 Jun 2010 00:36:27 +0000 (17:36 -0700) |
Compiler support for inline is sometimes buggy, and occasionally
missing entirely. This patch adds a test for inline support, and
redefines the keyword with the preprocessor if necessary at compile
time.
Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
missing entirely. This patch adds a test for inline support, and
redefines the keyword with the preprocessor if necessary at compile
time.
Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile | patch | blob | history | |
config.mak.in | patch | blob | history | |
configure.ac | patch | blob | history |
diff --git a/Makefile b/Makefile
index f3717f1e452ea75dc91fab96538d251f9a4b097a..7f6299650d6f72e88fcab34317cf4274016a5d72 100644 (file)
--- a/Makefile
+++ b/Makefile
# Define SOCKLEN_T to a suitable type (such as 'size_t') if your
# system headers do not define a socklen_t type.
#
+# Define INLINE to a suitable substitute (such as '__inline' or '') if git
+# fails to compile with errors about undefined inline functions or similar.
+#
# Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
# or vsnprintf() return -1 instead of number of characters which would
# have been written to the final string if enough space had been available.
BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d'
endif
+ifneq (,$(INLINE))
+ BASIC_CFLAGS += -Dinline=$(INLINE)
+endif
+
ifneq (,$(SOCKLEN_T))
BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)
endif
diff --git a/config.mak.in b/config.mak.in
index ed0f8f57de1ef1b973bf3f9be40150e9048354e0..e2dbd1c0bb862714a3b2b555d8460dde339a72d9 100644 (file)
--- a/config.mak.in
+++ b/config.mak.in
NO_ICONV=@NO_ICONV@
OLD_ICONV=@OLD_ICONV@
NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
+INLINE=@INLINE@
SOCKLEN_T=@SOCKLEN_T@
FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@
SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@
diff --git a/configure.ac b/configure.ac
index df831c35d46bba556084aa0861800b83536409a1..b33cc6a3163c818daf6a7002394af15268a9c9df 100644 (file)
--- a/configure.ac
+++ b/configure.ac
AC_MSG_NOTICE([CHECKS for programs])
#
AC_PROG_CC([cc gcc])
+AC_C_INLINE
+case $ac_cv_c_inline in
+ inline | yes | no) ;;
+ *) AC_SUBST([INLINE], [$ac_cv_c_inline]) ;;
+esac
+
# which switch to pass runtime path to dynamic libraries to the linker
AC_CACHE_CHECK([if linker supports -R], git_cv_ld_dashr, [
SAVE_LDFLAGS="${LDFLAGS}"