Actually, __declspec(dllexport) probably works fine. I had made the mistake of coding it as...

According to the (MS Docs), either of those is legal syntax. For their compiler at least. But see below.

But it exports it as XS_Foo_foo - which is not quite what I want.

That it is adding XS_* suggests to me that it is not a compiler facility as with MSC++, but rather a macro in one of the Perl specific header files somewhere. Perhaps something associated with the following from XSUB.H?

XSUB.h:# define XS(name) __declspec(dllexport) XSPROTO(name)

That said, The grep I just did that found that, also turned up the following tantalising snippet:

win32\win32.h:/* now even GCC supports __declspec() */

The grep also turned up a bunch of other __declspec references in 5.10.0 header files. I haven't pursued any of them.

Seems like it is mostly there but not quite. Maybe what's needed is a Perl specific extended-decl-modifier-seq to add the XS decorations: say XSdllexport so as not to conflict with the 'standard' dllexport.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^7: [XS on Win32] How to have the extension's dll export its symbols. by BrowserUk
in thread [XS on Win32] How to have the extension's dll export its symbols. by syphilis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.