public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: LIU Hao <lh_mouse@126.com>
To: xclaesse@gmail.com, gcc@gcc.gnu.org
Subject: Re: Issue with dllexport/dllimport inline function
Date: Tue, 11 Oct 2022 13:00:12 +0800	[thread overview]
Message-ID: <fcb4070d-c0b4-0f00-991c-a9b18ecf2a4b@126.com> (raw)
In-Reply-To: <f1c843ee6b97023927069a67de4ed1d0a7f27fa5.camel@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 818 bytes --]

在 2022/10/11 00:39, Xavier Claessens via Gcc 写道:
> 
> Is there a trick to get that working with GCC? Or should that issue be
> reported somewhere?
> 

Probably. This Microsoft `dllimport` with `inline` has the same semantics with GNU `extern inline`, 
so may be it's an alternative.


So instead of

   ```
   GLIB_API
   inline
   int g_strcmp0(const char*, const char*)
     { ...
   ```

you may try

   ```
   __attribute__((__gnu_inline__))
   extern inline
   int g_strcmp0(const char*, const char*)
     { ...
   ```

In contrast to C, you don't need the `extern` in C++.

When this function is being defined in a DLL, `__dllexport__` should be used in place of 
`__gnu_inline__`. This may require another macro, similar to `GLIB_API`.




-- 
Best regards,
LIU Hao

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2022-10-11  5:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10 16:39 xclaesse
2022-10-11  5:00 ` LIU Hao [this message]
2022-10-11 13:10   ` xclaesse
2022-10-11 13:28     ` LIU Hao
2022-10-11 13:35       ` LIU Hao
2022-10-11 14:26         ` xclaesse
2022-10-11 17:42           ` LIU Hao
2022-10-11 18:37             ` xclaesse
2022-10-12  3:03               ` LIU Hao
2022-11-01 15:38                 ` xclaesse
2022-11-01 16:06                   ` LIU Hao
2022-11-01 18:11                     ` xclaesse
2022-11-02  4:44                       ` LIU Hao
  -- strict thread matches above, loose matches on Subject: below --
2022-10-10 16:32 xclaesse

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

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

  git send-email \
    --in-reply-to=fcb4070d-c0b4-0f00-991c-a9b18ecf2a4b@126.com \
    --to=lh_mouse@126.com \
    --cc=gcc@gcc.gnu.org \
    --cc=xclaesse@gmail.com \
    /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).