[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Patch] inline.h should not define inline functions with "extern" li
From: |
Kevin Ryde |
Subject: |
Re: [Patch] inline.h should not define inline functions with "extern" linkage |
Date: |
Sat, 21 Jun 2003 11:30:42 +1000 |
User-agent: |
Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) |
Matthias Koeppe <address@hidden> writes:
>
> The "inline" keyword does not imply static linkage, and in fact
> inline.h defines the functions `scm_cell' and `scm_double_cell'
> explicitly with "extern" linkage.
"extern inline" is a gcc-ism, as far as I'm aware. We use it in
gmp.h, but only with gcc.
> The patch below fixes it. inline.c defines the functions with
> external linkage, and every file including inline.h defines static
> inline copies.
One possibility would be to do these things as macros, so as to avoid
depending on the compiler having an inline, or whether it only
actually inlines at certain optimization levels.
You can imagine the sort of thing, setting a variable given to the
macro, rather than a return value,
#define SCM_I_MKBIG(big)
do {
SCM __scm_i_mkbig__temp = scm_double_cell (scm_tc16_big, 0, 0, 0);
mpz_init (SCM_I_BIG_MPZ (__scm_i_mkbig__temp));
(big) = __scm_i_mkbig__temp;
} while (0)