Re: [vdagent-win 1/2] vdagent: file-xfer: fix compilation warnings when building with Visual Studio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What is the compilation warning?
I guess you could mention in the log that this readds uses of _s methods,
but substitute them with non _s methods on mingw through #define

On Sun, Mar 09, 2014 at 07:05:05PM +0200, Uri Lublin wrote:
> This patch reverts some of the changes made in commit
> 4b9e9b1d28ea7eaec44ff73e2f91c4064986b12a
> ---
>  vdagent/file_xfer.cpp | 23 +++++++++++++++++------
>  vdagent/file_xfer.h   |  2 +-
>  2 files changed, 18 insertions(+), 7 deletions(-)
> 
> diff --git a/vdagent/file_xfer.cpp b/vdagent/file_xfer.cpp
> index e402eb2..cdb5654 100644
> --- a/vdagent/file_xfer.cpp
> +++ b/vdagent/file_xfer.cpp
> @@ -18,7 +18,18 @@
>  #include <shlobj.h>
>  #define __STDC_FORMAT_MACROS
>  #define __USE_MINGW_ANSI_STDIO 1
> +
> +// compiler specific definitions
> +#ifdef _MSC_VER // compiling with Visual Studio
> +#define PRIu64 "I64u"
> +#else // compiling with mingw
>  #include <inttypes.h>
> +#define sscanf_s sscanf
> +//#define sprintf_s snprintf /* apprently sprintf_s is implemented in mingw */
> +#define strcpy_s(d, n, s) strncpy(d, s, n)
> +#define strcat_s(d, n, s) strncat(d, s, n)
> +#endif // compiler specific definitions
> +
>  #include <stdio.h>
>  #include "file_xfer.h"
>  #include "as_user.h"
> @@ -75,12 +86,12 @@ void FileXfer::handle_start(VDAgentFileXferStartMessage* start,
>      }
> 
>      if (strlen(file_path) + strlen(file_name) + 1 >= MAX_PATH) {
> -        vd_printf("error: file too long %s\%s", file_path, file_name);
> +        vd_printf("error: file too long %s\\%s", file_path, file_name);

Can you split this in a separate commit?

Thanks,

Christophe

Attachment: pgp9ikTxnBSBq.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]