GNOME Bugzilla – Bug 670128
G_STRFUNC does not work on Visual Studio platform (_MSC_VER defined)
Last modified: 2012-02-24 21:22:28 UTC
When using glib in Visual Studio, G_STRFUNC is defined as (const char *)) "???" ) When _MSC_VER is defined G_STRFUNC could be defined as __FUNCTION__ According to MSDN (http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.71).aspx) __FUNCTION__ is defined since (at least) Microsoft Visual Studio .NET 2003
A tested patch would very much be appreciated. Thanks in advance.
Created attachment 207736 [details] [review] G_STRFUNC for Visual Studio platform
Review of attachment 207736 [details] [review]: ::: glib/gmacros.h @@ +168,3 @@ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 19901L # define G_STRFUNC ((const char*) (__func__)) +#elif defined(_MSC_VER) && (_MSC_VER > 1300) Stupid question, but you said "since (at least) Microsoft Visual Studio .NET 2003" but here you're using >, not >=. What's the _MSC_VER for .NET 2003? Is it greater than 1300?
Review of attachment 207736 [details] [review]: ::: glib/gmacros.h @@ +168,3 @@ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 19901L # define G_STRFUNC ((const char*) (__func__)) +#elif defined(_MSC_VER) && (_MSC_VER > 1300) Visual Studio .NET 2003 has _MSC_VER == 1310 (http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx) the previous version is MSVC++ 7.0 that has _MSC_VER == 1300. If you prefer you can put _MSC_VER >= 1310, but it is the same
(In reply to comment #4) > > Visual Studio .NET 2003 has _MSC_VER == 1310 > (http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx) > the previous version is MSVC++ 7.0 that has _MSC_VER == 1300. > If you prefer you can put _MSC_VER >= 1310, but it is the same Ok, just wanted to double check. Patch looks fine, do you have commit access?
Ok, fine. No, I don't have commit access.
Okay. I've pushed the patch for you. Thanks for the contribution!