Re: [xml] win32\VC10\config.h and VS 2015

2016-03-11 Thread Bruce Dawson
Now is an odd time to be writing snprintf fallbacks for older MSVC versions
- I look forward to never building with such versions again!

Could be useful for some people of course, but it is a diminishing audience.

On Fri, Mar 11, 2016 at 1:24 PM, Nick Wellnhofer 
wrote:

> On 07/03/2016 22:46, Bruce Dawson wrote:
>
>> The config.h file in win32\VC10 is incompatible with VS 2015 because VS
>> 2015
>> provides an implementation of snprintf and prohibits using the
>> preprocessor to
>> define it. Therefor an ifdef check is needed around that definition in
>> VC10\config.h. Here is a patch that is compatible with the change that we
>> made
>> to Chromium's copy:
>>
>>
>> diff --git a/win32/VC10/config.h b/win32/VC10/config.h
>> index 8629944..891b57e 100644
>> --- a/win32/VC10/config.h
>> +++ b/win32/VC10/config.h
>> @@ -96,7 +96,9 @@ static int isnan (double d) {
>>
>>   #if defined(_MSC_VER)
>>   #define mkdir(p,m) _mkdir(p)
>> +#if _MSC_VER < 1900 // Cannot define this in VS 2015 and above!
>>   #define snprintf _snprintf
>> +#endif
>>   #if _MSC_VER < 1500
>>   #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
>>   #endif
>>
>>
>> It would be great to get that same patch in libxml2, and other developers
>> will
>> need it if they use VC10\config.h.
>>
>
> If you're at it, can you implement a better snprintf fallback for older
> MSVC versions? Here's the change I made to libxslt:
>
>
> https://git.gnome.org/browse/libxslt/commit/?id=e75b5da121cdc67cb2303b1e2b77d5dd1cdf2784
>
> For background information see:
>
> https://bugzilla.gnome.org/show_bug.cgi?id=756691
> http://stackoverflow.com/a/8712996/1956010
>
> Nick
>
>


-- 
Bruce Dawson
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] win32\VC10\config.h and VS 2015

2016-03-11 Thread Nick Wellnhofer

On 07/03/2016 22:46, Bruce Dawson wrote:

The config.h file in win32\VC10 is incompatible with VS 2015 because VS 2015
provides an implementation of snprintf and prohibits using the preprocessor to
define it. Therefor an ifdef check is needed around that definition in
VC10\config.h. Here is a patch that is compatible with the change that we made
to Chromium's copy:


diff --git a/win32/VC10/config.h b/win32/VC10/config.h
index 8629944..891b57e 100644
--- a/win32/VC10/config.h
+++ b/win32/VC10/config.h
@@ -96,7 +96,9 @@ static int isnan (double d) {

  #if defined(_MSC_VER)
  #define mkdir(p,m) _mkdir(p)
+#if _MSC_VER < 1900 // Cannot define this in VS 2015 and above!
  #define snprintf _snprintf
+#endif
  #if _MSC_VER < 1500
  #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
  #endif


It would be great to get that same patch in libxml2, and other developers will
need it if they use VC10\config.h.


If you're at it, can you implement a better snprintf fallback for older MSVC 
versions? Here's the change I made to libxslt:


https://git.gnome.org/browse/libxslt/commit/?id=e75b5da121cdc67cb2303b1e2b77d5dd1cdf2784

For background information see:

https://bugzilla.gnome.org/show_bug.cgi?id=756691
http://stackoverflow.com/a/8712996/1956010

Nick

___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] win32\VC10\config.h and VS 2015

2016-03-11 Thread Daniel Veillard
On Tue, Mar 08, 2016 at 12:30:45PM +0100, Michael Stahl wrote:
> On 08.03.2016 12:27, Michael Stahl wrote:
> > On 07.03.2016 22:46, Bruce Dawson wrote:
> >>
> >> It would be great to get that same patch in libxml2, and other
> >> developers will need it if they use VC10\config.h.
> > 
> > it looks like release 2.9.3 already includes this fix, i've had to
> > remove a similar patch when upgrading LibreOffice's bundled copy :)
> 
> oops - i should have read your other mail first :)
> 
> the include/win32config.h has the fix, but the win32/VC10/config.h
> (which i didn't even know existed) does not.

  Okay, for now I pushed the change (I have no way to test this TBH)

https://git.gnome.org/browse/libxml2/commit/?id=dfbacd4f417cb0f4b9bef3ff205bf95cb73c5717

   thanks !

Daniel

-- 
Daniel Veillard  | Open Source and Standards, Red Hat
veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] win32\VC10\config.h and VS 2015

2016-03-08 Thread Michael Stahl
On 08.03.2016 12:27, Michael Stahl wrote:
> On 07.03.2016 22:46, Bruce Dawson wrote:
>>
>> It would be great to get that same patch in libxml2, and other
>> developers will need it if they use VC10\config.h.
> 
> it looks like release 2.9.3 already includes this fix, i've had to
> remove a similar patch when upgrading LibreOffice's bundled copy :)

oops - i should have read your other mail first :)

the include/win32config.h has the fix, but the win32/VC10/config.h
(which i didn't even know existed) does not.



___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] win32\VC10\config.h and VS 2015

2016-03-08 Thread Michael Stahl
On 07.03.2016 22:46, Bruce Dawson wrote:
> The config.h file in win32\VC10 is incompatible with VS 2015 because VS
> 2015 provides an implementation of snprintf and prohibits using the
> preprocessor to define it. Therefor an ifdef check is needed around that
> definition in VC10\config.h. Here is a patch that is compatible with the
> change that we made to Chromium's copy:
> 
> 
> diff --git a/win32/VC10/config.h b/win32/VC10/config.h
> index 8629944..891b57e 100644
> --- a/win32/VC10/config.h
> +++ b/win32/VC10/config.h
> @@ -96,7 +96,9 @@ static int isnan (double d) {
> 
>  #if defined(_MSC_VER)
>  #define mkdir(p,m) _mkdir(p)
> +#if _MSC_VER < 1900 // Cannot define this in VS 2015 and above!
>  #define snprintf _snprintf
> +#endif
>  #if _MSC_VER < 1500
>  #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
>  #endif
> 
> 
> It would be great to get that same patch in libxml2, and other
> developers will need it if they use VC10\config.h.

it looks like release 2.9.3 already includes this fix, i've had to
remove a similar patch when upgrading LibreOffice's bundled copy :)


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


[xml] win32\VC10\config.h and VS 2015

2016-03-07 Thread Bruce Dawson
The config.h file in win32\VC10 is incompatible with VS 2015 because VS
2015 provides an implementation of snprintf and prohibits using the
preprocessor to define it. Therefor an ifdef check is needed around that
definition in VC10\config.h. Here is a patch that is compatible with the
change that we made to Chromium's copy:


diff --git a/win32/VC10/config.h b/win32/VC10/config.h
index 8629944..891b57e 100644
--- a/win32/VC10/config.h
+++ b/win32/VC10/config.h
@@ -96,7 +96,9 @@ static int isnan (double d) {

 #if defined(_MSC_VER)
 #define mkdir(p,m) _mkdir(p)
+#if _MSC_VER < 1900 // Cannot define this in VS 2015 and above!
 #define snprintf _snprintf
+#endif
 #if _MSC_VER < 1500
 #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
 #endif


It would be great to get that same patch in libxml2, and other developers
will need it if they use VC10\config.h.

-- 
Bruce Dawson
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml