Fix "mixed linkage" errors in `inline.h'.
authorLudovic Courtès <ludo@gnu.org>
Sun, 2 Mar 2008 16:28:04 +0000 (16:28 +0000)
committerLudovic Courtès <ludo@gnu.org>
Sun, 2 Mar 2008 16:28:04 +0000 (16:28 +0000)
NEWS
libguile/ChangeLog
libguile/inline.h
libguile/pairs.h

diff --git a/NEWS b/NEWS
index 640fa12ea6aedd229c84096fbf545b13b6790f8d..ab2e94bb77b07b6814983717dd9bfa06f5d8cca1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ would trigger an unbound variable error for `match:andmap'.
 ** Fixed build issue for GNU/Linux on IA64
 ** Fixed build issues on NetBSD 1.6
 ** Fixed build issue on Solaris 2.10 x86_64
+** Fixed build issue with DEC/Compaq/HP's compiler
 
 * Changes to the distribution
 
index 82a52de8357902210d052c911008fcc6d5ca567e..4bfe9f91bcc1a8f50498b986c2c0017b8e7cdf1f 100644 (file)
@@ -1,3 +1,11 @@
+2008-03-02  Ludovic Courtès  <ludo@gnu.org>
+
+       * pairs.h (scm_is_pair): Moved declaration to `inline.h'.
+       * inline.h: Make sure `extern' declarations are not produced
+       when `inline' is supported but GCC is not used.  This
+       fixes "mixed linkage" errors with compilers such as
+       DEC/Compaq/HP CC.
+
 2008-02-27  Neil Jerram  <neil@ossau.uklinux.net>
 
        * _scm.h (errno): Remove declarations that have been there
index 621b4fb364b9076debe0cab74d8bcfa634c52147..a27024bea0f9c64805357bdd1b8e29221e8e4b3c 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef SCM_INLINE_H
 #define SCM_INLINE_H
 
-/* Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
 #include "libguile/pairs.h"
 
 
+#if ((!defined SCM_C_INLINE) && (!defined SCM_INLINE_C_INCLUDING_INLINE_H)) \
+     || (defined __GNUC__)
+
+/* The `extern' declarations.  They should only appear when used from
+   "inline.c", when `inline' is not supported at all or when GCC's "extern
+   inline" is used.  */
+
 SCM_API SCM scm_cell (scm_t_bits car, scm_t_bits cdr);
 SCM_API SCM scm_double_cell (scm_t_bits car, scm_t_bits cbr,
                             scm_t_bits ccr, scm_t_bits cdr);
@@ -45,6 +52,10 @@ SCM_API SCM scm_double_cell (scm_t_bits car, scm_t_bits cbr,
 SCM_API SCM scm_array_handle_ref (scm_t_array_handle *h, ssize_t pos);
 SCM_API void scm_array_handle_set (scm_t_array_handle *h, ssize_t pos, SCM val);
 
+SCM_API int scm_is_pair (SCM x);
+
+#endif
+
 
 #if defined SCM_C_INLINE || defined SCM_INLINE_C_INCLUDING_INLINE_H
 /* either inlining, or being included from inline.c.  We use (and
index c30f4c564ff445963d0158327667849b2646c3c6..dd22ff36ecb63d66ea95711224ffdb5f51e9eda3 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef SCM_PAIRS_H
 #define SCM_PAIRS_H
 
-/* Copyright (C) 1995,1996,2000,2001, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,2000,2001, 2004, 2006, 2008 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -78,8 +78,6 @@
 SCM_API void scm_error_pair_access (SCM);
 #endif
 
-SCM_API int scm_is_pair (SCM x);
-
 SCM_API SCM scm_cons (SCM x, SCM y);
 SCM_API SCM scm_cons2 (SCM w, SCM x, SCM y);
 SCM_API SCM scm_pair_p (SCM x);