From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by sourceware.org (Postfix) with ESMTPS id 41E103858C2D for ; Tue, 11 Oct 2022 13:10:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 41E103858C2D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-x734.google.com with SMTP id a5so3367225qkl.6 for ; Tue, 11 Oct 2022 06:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=xUXE1KaTNrIb+Vg6ehw7SYUcmdGD7Pv6jhwlfHPc3hc=; b=F0Y1FaKpTtYkVF0bn/jlyfM2nuACSuB7WR/SUxRNa0HnmWLAIwL4a+ENGw6pdxld9e taM5KagalvEr+6o1BYJ/3eK5oNq7ha+6+UJourjpc//Zspujv8phU6qQ7/r1Gz1pBZO1 M0NqU1yEdP49OWrLGNUmXRFu6g9e2oYDQfTFEe516Ta4Mtk9Rm3w7xuDMKR1TF025V64 cpIYCTPmb3VBm8zPqvr57nNHKcTV8pyNIkmlS4B33Sci57uCHMEex3gru3kI7eesVVqJ rGsff1SrecbyRODQh25febgqnJyw3/iKnjkot8W7Je7J6Ut6BB+kp6o5oLBDwzU3ya1A ZPwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xUXE1KaTNrIb+Vg6ehw7SYUcmdGD7Pv6jhwlfHPc3hc=; b=I4wposM+KvAZp0S6WpwOxmutq17kQHROC2fJB/Bgn5Mq41EjeLaBpG50nGZAoKiY0c TeGSialb+MnFUeYw/QcBL0NznECJW9hxLer9qUQo5spUn7ur7BvUhsvPMx6bCLfVIEF9 qkOERuZlbjVgDuTlsBs9AHd4nqwqFr/dLwHECq34t6g9k9VyAnc5ViKQamktiwgDFMDG WrBQSG/+/wVr9zopLjE6MqJlFN3YXSvuGuuu5QiAbbbicJD7/RbxcMfI3NxaSjMtidRg TVlaSDt53V193t3/Wrg210ZeIlIWccjowbVGyf0tBXR7rjYMntRMRP+u7jxH9CG59Izx 9Xjg== X-Gm-Message-State: ACrzQf0m8F2I1iNHQhz6BYD8I+GMVq2ggBorm4iJAglnqvmYaoP/u0wP vYuAzU7Y7q7syqBmWJNWgmg= X-Google-Smtp-Source: AMsMyM7NHfeC8P6Jqo3xOPbllBRUEq8/jOT15wFXzSMGammVhoBCw8oVPvhxSshY+BYxvqUrv852qQ== X-Received: by 2002:a37:af84:0:b0:6ec:543e:cb24 with SMTP id y126-20020a37af84000000b006ec543ecb24mr8957747qke.562.1665493816381; Tue, 11 Oct 2022 06:10:16 -0700 (PDT) Received: from [192.168.0.2] ([192.222.225.228]) by smtp.gmail.com with ESMTPSA id cr12-20020a05622a428c00b003434d3b5938sm10560459qtb.2.2022.10.11.06.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 06:10:15 -0700 (PDT) Message-ID: <845fde640ac4cd51c8bb50373f146987b3d26893.camel@gmail.com> Subject: Re: Issue with dllexport/dllimport inline function From: xclaesse@gmail.com To: LIU Hao , gcc@gcc.gnu.org Date: Tue, 11 Oct 2022 09:10:15 -0400 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Le mardi 11 octobre 2022 =C3=A0 13:00 +0800, LIU Hao a =C3=A9crit=C2=A0: > you may try >=20 > =C2=A0=C2=A0 ``` > =C2=A0=C2=A0 __attribute__((__gnu_inline__)) > =C2=A0=C2=A0 extern inline > =C2=A0=C2=A0 int g_strcmp0(const char*, const char*) > =C2=A0=C2=A0=C2=A0=C2=A0 { ... > =C2=A0=C2=A0 ``` Thanks, I gave that a try but I get many: multiple definition of `g_strcmp0'. But at least the warning about dllimport is now gone. > In contrast to C, you don't need the `extern` in C++. >=20 > When this function is being defined in a DLL, `__dllexport__` should > be used in place of=20 > `__gnu_inline__`. This may require another macro, similar to > `GLIB_API`.