_snprintf vs snprintf + proposed patch
Hello, When working on my port of wrc to windows I had to change snprintf to _snprintf in ppy.y on line 294 to build under mingw. I checked the msdn and didn't find anything on snprintf or _snprintf so I don't know if this patch will work for building under visual studio. Do I need to make a check for HAVE_SNPRINTF? I'm using msys and mingw so I can write a configure check if that is what is needed. Thanks Steven cvs diff ppy.y Index: ppy.y =================================================================== RCS file: /home/wine/wine/tools/wrc/ppy.y,v retrieving revision 1.7 diff -u -r1.7 ppy.y --- ppy.y 10 Mar 2002 00:24:24 -0000 1.7 +++ ppy.y 18 Mar 2002 07:43:30 -0000 @@ -289,7 +289,11 @@ | tRCINCLUDE tRCINCLUDEPATH { int nl=strlen($2) +3; char *fn=xmalloc(nl); + #ifdef _WINDOWS + _snprintf(fn,nl,"\"%s\"",$2); + #else snprintf(fn,nl,"\"%s\"",$2); + #endif /* _WINDOWS */ free($2); do_include(fn,1); } _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
"Steven Edwards" <Steven_Ed4153(a)yahoo.com> writes:
Do I need to make a check for HAVE_SNPRINTF? I'm using msys and mingw so I can write a configure check if that is what is needed.
Yes, you should add a configure check and probably a #define in wine/port.h. Check how Patrik did it for popen vs. _popen. -- Alexandre Julliard julliard(a)winehq.com
K I'll have you some patches in a few days......time to learn autoconf. =P Steven -----Original Message----- From: wine-devel-admin(a)winehq.com [mailto:wine-devel-admin(a)winehq.com] On Behalf Of Alexandre Julliard Sent: Monday, March 18, 2002 5:05 PM To: Steven_Ed4153(a)yahoo.com Cc: wine-devel(a)winehq.com Subject: Re: _snprintf vs snprintf + proposed patch "Steven Edwards" <Steven_Ed4153(a)yahoo.com> writes:
Do I need to make a check for HAVE_SNPRINTF? I'm using msys and mingw so I can write a configure check if that is what is needed.
Yes, you should add a configure check and probably a #define in wine/port.h. Check how Patrik did it for popen vs. _popen. -- Alexandre Julliard julliard(a)winehq.com _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
participants (2)
-
Alexandre Julliard -
Steven Edwards