delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/09/12/20:41:27

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <CAHXt_SVJTPFfEkW1zJcWiY84PhTNfbVRCxZKyfb+sziRYs=u8g@mail.gmail.com>
References: <CAHXt_SVJTPFfEkW1zJcWiY84PhTNfbVRCxZKyfb+sziRYs=u8g AT mail DOT gmail DOT com>
From: Andrew Pennebaker <andrew DOT pennebaker AT gmail DOT com>
Date: Wed, 12 Sep 2012 20:40:43 -0400
Message-ID: <CAHXt_SW-dim7t-x76AbwCCdPr5QGtdEMByJB1xW24A1=7-v3mA@mail.gmail.com>
Subject: Re: MinGW's GCC and __attribute__((weak))
To: Cygwin <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

I found a solution using simple preprocessor instructions.

http://stackoverflow.com/a/12397886/350106

Cheers,

Andrew Pennebaker
www.yellosoft.us

On Wed, Sep 12, 2012 at 5:33 PM, Andrew Pennebaker
<andrew DOT pennebaker AT gmail DOT com> wrote:
>
> Am I correct in assuming that gcc/MinGW builds on top of Cygwin?
> Because I'm having trouble getting gcc to recognize
> __attribute__((weak)) in Windows, where the exact same C source code
> compile just fine with gcc in an ordinary Unix (Mac OS X as it
> happens) environment.
>
> I love how you can bundle a framework and CLI in the same Perl script,
> by using unless(caller) { main; }. For lack of a better name, I've
> started calling this behavior scriptedmain. Here's a Perl script
> example (https://github.com/mcandre/scriptedmain/tree/master/perl).
>
> I want to be able to do the same thing in C, and with help from
> StackOverflow I've gotten working C code to do just that, in Unix.
> Unfortunately, the C code
> (http://stackoverflow.com/questions/12395130/trouble-using-scriptedmain-in-mingw)
> doesn't compile in Windows, because gcc/MinGW and gcc/Strawberry Perl
> fail to recognize __attribute__((weak)) syntax. Is there another way I
> can rewrite my code for MinGW's gcc so that it compiles and works like
> the Perl scriptedmain? Or can we add __attribute__((weak)) to MinGW's
> gcc lexicon?
>
> I will also be asking the Strawberry Perl project about their gcc in
> case some minor configuration tweak can get this working.
>
> Cheers,
>
> Andrew Pennebaker
> www.yellosoft.us

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019