<div dir="ltr">On Sun, Nov 10, 2013 at 12:28 PM, John Emmas <span dir="ltr"><<a href="mailto:johne53@tiscali.co.uk" target="_blank">johne53@tiscali.co.uk</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi guys,<br>
<br>
According to the cairomm information page, this is the correct mailing list for asking questions about cairomm. I hope that information's still current. I have a simple question about building cairomm with MSVC.<br>
<br>
After downloading cairomm from git, I can see that it contains a number of MSVC projects. AFAICT the various tests tend to build exes whereas the libraries are mostly built as DLLs. When building DLLs for Windows its common (in fact, mandatory AFAIK) to use __declspec for indicating when a symbol needs to get imported from a DLL.</blockquote>
<div><br></div><div>See <a href="http://msdn.microsoft.com/en-us/library/aa271769(v=vs.60).aspx">http://msdn.microsoft.com/en-us/library/aa271769(v=vs.60).aspx</a><br></div><div>__declspec(import) is mandatory for variables, but for functions it is just an optimization which removes a jump.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> Exporting is slightly different because a module definition file can be used instead of __declspec. Indeed, I can see that the cairomm.vcproj files do generate a ".def" file at build time. But it still leaves the problem of how an application will know that cairomm.lib is the symbols library for a DLL as opposed to a regular static lib. This is the most common strategy... I've taken glibmm as an example because it also uses gendef:-<br>
<br>
#ifdef GLIBMM_DLL<br>
#if defined(GLIBMM_BUILD) && defined(_WINDLL)<br>
/* Do not dllexport as it is handled by gendef on MSVC */<br>
#define GLIBMM_API<br>
#elif !defined(GLIBMM_BUILD)<br>
#define GLIBMM_API __declspec(dllimport)<br>
#else<br>
/* Build a static library */<br>
#define GLIBMM_API<br>
#endif /* GLIBMM_BUILD - _WINDLL */<br>
#else<br>
#define GLIBMM_API<br>
#endif /* GLIBMM_DLL */<br>
<br>
I've looked for something similar in cairomm but I couldn't find anything. In fact, I couldn't find any use of __declspec at all, so how does this work in cairomm?<span class=""><font color="#888888"><br></font></span></blockquote>
<div><br></div><div>The idea is that the jump optimization is not usually needed.<br>If in your usage, it has a significant performance impact, could you provide some testcases to reproduce the issue?<br></div><div>(I agree that a better handling of win32 DLLs would be quite desirable, but right now I'm more concerned with other issues, like initialization and TLS).<br>
</div><div><br></div><div>Andrea<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><font color="#888888">
<br>
John<br>
-- <br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org" target="_blank">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.<u></u>org/mailman/listinfo/cairo</a><br>
</font></span></blockquote></div><br></div></div>