On Sat, Feb 18, 2012 at 6:22 PM, Andy Hefner <ahef...@gmail.com> wrote:
> With
> "-std=c99" enabled, I'd see a mix of calls to things like "_ecl_car"
> that don't link, alongside the correct "ecl_car".  I don't understand
> how GCC's C99 support affects identifier names, but there's probably a
> simple fix for this.

Oh, how silly of me. It had nothing to do with symbol prefixes, but
rather the inline versions of these built-in functions: the
conditional expression determining ECL_CAN_INLINE fails in C99 mode,
converting these to external symbols, inconsistent with how the
library was built - _ecl_car and the like aren't defined at all if
ECL_CAN_INLINE is true when the shared library is built.

I've attached a patch which changes the conditional in config.h to
test GCC's __GNUC_GNU_INLINE__ and __GNUC_STDC_INLINE__ macros for
deciding ECL_CAN_INLINE. I've tried ECL built in default (gnu90) and
c99 modes, and in both cases ECL_CAN_INLINE is true as expected and my
inline C99 code works. This should still do the right thing for strict
C89/C90 modes, but I haven't tested it.
diff --git a/src/h/config.h.in b/src/h/config.h.in
index 37e5948..b799c9a 100644
--- a/src/h/config.h.in
+++ b/src/h/config.h.in
@@ -224,7 +224,9 @@ typedef unsigned char ecl_base_char;
  * C macros for inlining, denoting probable code paths and other stuff
  * that makes better code. Most of it is GCC specific.
  */
-#if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#if defined(__cplusplus) || \
+    (defined(__GNUC__) &&   \
+    (defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)))
 #define ECL_INLINE inline
 #define ECL_CAN_INLINE 1
 #else
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to