Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On Mon, Jul 01, 2013 at 12:17:41AM -0500, Norbert Thiebaud wrote:
On Sun, Jun 30, 2013 at 2:05 PM, Andrzej J. R. Hunt <andrzej@ahunt.org> wrote:

Finally I've had to do things like replace snprintf with _snprintf --
currently decided using an ifdef -- this seems somewhat unclean but I'm
not sure of any better way to do this.

A Windows expert will maybe correct me, but I think this "_" prefix is
just part of the Windows ABI (name mangling or C name decoration) and
thus should not be in the source code. It should be added
~automatically by the compiler. Since you mention mingw, maybe there
is some subtlety there, but my guess is that the right solution is
something like adding "_cdecl" in front of the function declaration
(not at each call). Or maybe passing some command-line option to the
compiler that means --respect-microsoft-calling-conventions

https://en.wikipedia.org/wiki/Name_mangling#C_name_decoration_in_Microsoft_Windows

-- 
Lionel

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.