-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Pierre Ossman wrote:
> On Thu, 08 Oct 2009 03:06:49 +0700
> Antoine Martin <anto...@nagafix.co.uk> wrote:
> 
>> Hi,
>>
>> I eventually managed to build TigerVNC with VC++ 9
>> Attached are the trivial changes that I had to make.
>> Can anyone suggest a better way of fixing those compilation errors?
>> What sort of a patch would be acceptable for merging?
>>
>> Mostly, just:
>> * casts
>> * afxres.h -> windows.h (and add #define IDC_STATIC -1)
>>
>> FYI: I also had to comment out this line in VC's stdio.h:
>> _Check_return_opt_ _CRT_INSECURE_DEPRECATE(vsnprintf_s) _CRTIMP int
>> __cdecl vsnprintf(_Out_cap_(_MaxCount) char * _DstBuf, _In_ size_t
>> _MaxCount, _In_z_ _Printf_format_string_ const char * _Format, va_list
>> _ArgList);
>> Which gives me lots of warnings, but at least it builds...
>>
>> Now at least I can try to solve my real problems (PasswordFile, etc..)
>>
> 
> It looks like you're building a unicode version of the software. The
> system is not really designed for that, so even if you get it to
> compile I suspect you'll get subtle and hard to debug problems.
> 
> (Using LPTSTR would make things compiler both with and without unicode,
> but it really only hides the problem)
OK, does anyone know a proper solution for this?

Without commenting out this line, here is the error that I get:
[...]
Exception.cxx
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(358) :
error C3163: '_vsnprintf': attributes inconsistent with previous declaration
        C:\Program Files\Microsoft Visual Studio
9.0\VC\include\stdio.h(350) : see declaration of '_vsnprintf'


The relevant lines from stdio.h are (350 to 358):
_Check_return_opt_ _CRT_INSECURE_DEPRECATE(vsnprintf_s) _CRTIMP int
__cdecl vsnprintf(_Out_cap_(_MaxCount) char * _DstBuf, _In_ size_t
_MaxCount, _In_z_ _Printf_format_string_ const char * _Format, va_list
_ArgList);
#if __STDC_WANT_SECURE_LIB__
_Check_return_opt_ _CRTIMP int __cdecl vsnprintf_s(_Out_z_cap_(_DstSize)
char * _DstBuf, _In_ size_t _DstSize, _In_ size_t _MaxCount, _In_z_
_Printf_format_string_ const char * _Format, va_list _ArgList);
#endif
_Check_return_opt_ _CRTIMP_ALTERNATIVE int __cdecl
_vsnprintf_s(_Out_z_cap_(_SizeInBytes) char * _DstBuf, _In_ size_t
_SizeInBytes, _In_ size_t _MaxCount, _In_z_ _Printf_format_string_ const
char * _Format, va_list _ArgList);
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_3(int, _vsnprintf_s, char, _Dest,
_In_ size_t, _MaxCount, _In_z_ _Printf_format_string_ const char *,
_Format, va_list, _Args)
#pragma warning(push)
#pragma warning(disable:4793)
__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX(int,
__RETURN_POLICY_SAME, _CRTIMP, _snprintf, _vsnprintf, _Pre_notnull_
_Post_maybez_ char, _Out_cap_(_Count) _Post_maybez_, char, _Dest, _In_
size_t, _Count, _In_z_ _Printf_format_string_ const char *, _Format)

Why _vsnprintf seems to be conflicting from within Microsoft's own
stdio.h is beyond me (AFAIK this is the stdio.h that comes with VC++).

Thanks
Antoine
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREKAAYFAkrOR10ACgkQGK2zHPGK1rvQpgCfZRYcQf5afE3ySgQjhJMHMi2B
Yr8An0ncLX3i2XSJyyUQdYCDaMmS1wHT
=0AGA
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tigervnc-devel mailing list
Tigervnc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-devel

Reply via email to