On 02/28/2012 05:38 PM, Paul Eggert wrote: > On 02/28/2012 04:01 PM, Bruno Haible wrote: >> But unfortunately there are also other possible elements in a declspec >> list, see [1]. I don't see how to accommodate these. > > [1] is for Visual Studio 2005; Visual Studio 2010 also has 'safebuffers' > <http://msdn.microsoft.com/en-us/library/dabb5z75%28v=vs.100%29.aspx>. > If this latter is an exhaustive list, can we wrap each of these? > E.g., define __wrapped_align, __wrapped_allocate, __wrapped_appdomain,
But if I'm reading the page right, it's valid to do: __declspec(nothrow noreturn) and token pasting will only cover the first word of the space-separated list. I think we're stuck on the wrapper re-write approach. >> The other, equally extreme, solution is to add >> >> #ifdef _MSC_VER >> # include <stdlib.h> >> # include <setjmp.h> >> # include <process.h> >> #endif > > Is this the complete list of MSVC include files that use > __declspec(noreturn)? If so, that might work too. But > it sounds more fragile than wrapping the list of __declspec > keywords. > > Thanks for these ideas. If either of them work, I suppose > we can use them, but if there are problems with both of them > at least we have the simpler fallback of > "#define noreturn /* nothing */" on MSVC. I'm leaning towards "#define noreturn /**/" as well. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature