unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>
Subject: Re: [Patch] inline.h should not define inline functions with "extern" linkage
Date: Mon, 23 Jun 2003 10:40:40 +0200	[thread overview]
Message-ID: <uw5smq1rxtj.fsf@saturn.math.uni-magdeburg.de> (raw)
In-Reply-To: <87el1ocj3x.fsf@zip.com.au> (Kevin Ryde's message of "Sat, 21 Jun 2003 11:30:42 +1000")

Kevin Ryde <user42@zip.com.au> writes:

> Matthias Koeppe <mkoeppe@merkur.math.uni-magdeburg.de> 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.

Yes.  

>> 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)

CVS Guile uses a different method to deal with possibly inlined
functions.  

inline.c defines ("extern", non-"inline") versions for use in
user programs.

If the C compiler recognizes an "inline" keyword, inline.h defines
"inline" versions of the functions.  However, there the gcc-ism of
"extern inline" was used.  My patch gets rid of this gcc-ism.  This
makes the compilation work with the Sun Forte compiler.

I have adapted this approach to the inline functions in numbers.c.

-- 
Matthias Koeppe -- http://www.math.uni-magdeburg.de/~mkoeppe


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2003-06-23  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-19 12:51 [Patch] inline.h should not define inline functions with "extern" linkage Matthias Koeppe
2003-06-21  1:30 ` Kevin Ryde
2003-06-23  8:40   ` Matthias Koeppe [this message]
2003-09-12 14:13 ` Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uw5smq1rxtj.fsf@saturn.math.uni-magdeburg.de \
    --to=mkoeppe@mail.math.uni-magdeburg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).