Re: Strawberry's GCC and __attribute__((weak))
[email protected] (Andrew Pennebaker) Wed, 12 Sep 2012 20:41:14 -0400
| Newsgroups | perl.win32.vanilla |
|---|---|
| Message-ID | <CAHXt_SW8V973MKyvBQukxxtzk7-=Bf=mxhk1vsH4xb2Xqy8iyA@mail.gmail.com> |
I found a solution using preprocessor instructions. http://stackoverflow.com/a/12397886/350106 Cheers, Andrew Pennebaker www.yellosoft.us On Wed, Sep 12, 2012 at 4:01 PM, Andrew Pennebaker < [email protected]> wrote: > 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. > > 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 doesn't compile in Windows, because gcc/Strawberry > and gcc/MinGW fail to recognize __attribute__((weak)) syntax. Is there > another way I can rewrite my code for Strawberry Perl's gcc so that it > compiles and works like the Perl scriptedmain? Or can we add > __attribute__((weak)) to Strawberry Perl's gcc lexicon? > > I will also be asking the MinGW project about their gcc in case some minor > cygwin configuration can get this working. > > Cheers, > > Andrew Pennebaker > www.yellosoft.us