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

[PATCH] Autoconf: Disable inline for compilers that don't support it.

From
Allan Caffee <allan.caffee@gmail.com>
Date
Mar 14, 2009, 01:04 UTC
Message-ID
<20090314010421.GA6642@linux.vnet>
In-Reply-To
<20090114223832.GC30710@genesis.frugalware.org>

The Autoconf macro AC_C_INLINE will redefine the inline keyword to whatever the current compiler supports (including possibly nothing).

Signed-off-by: Allan Caffee <allan.caffee@gmail.com>
---
On Wed, 14 Jan 2009, Miklos Vajna wrote:
Show 7 quoted lines
> On Wed, Jan 14, 2009 at 01:32:56PM -0500, Corey Stup
> <coreystup@gmail.com> wrote:
> > When trying to compile with a C89 compliant compiler, I'm coming
> > across a couple issues:
> > - "inline" use
>
> AFAIK that can be avoided with -Dinline=.

But some compilers support other variations of this like __inline__ or __inline. Luckily Autoconf has a builtin method for handling this.

diff --git a/configure.ac b/configure.ac
index 082a03d..69fa25e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -308,6 +308,9 @@ AC_SUBST(OLD_ICONV)
 ## Checks for typedefs, structures, and compiler characteristics.
 AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics])
 #
+# Check for compilers ability to inline functions.
+AC_C_INLINE
+#
 # 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=],
-- 
1.5.4.3
Previous: Miklos VajnaNext: Junio C Hamano
Message 3 of 7 in “Compiler requirements for git?”
  1. Corey StupJan 14, 2009
  2. Miklos VajnaJan 14, 2009
  3. Autoconf: Disable inline for compilers that don't support it.Allan Caffee, Mar 14, 2009
  4. Junio C HamanoMar 14, 2009
  5. Allan CaffeeMar 15, 2009
  6. Junio C HamanoMar 15, 2009
  7. Allan CaffeeMar 16, 2009

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.