Navigation Menu

Skip to content

Commit

Permalink
windows: suppress warning by msgpack
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 21, 2018
1 parent 398976b commit 7c408a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/grn_msgpack.h
Expand Up @@ -21,9 +21,9 @@
#include "grn.h"

#ifdef GRN_WITH_MESSAGE_PACK
# define _CRT_SECURE_NO_WARNINGS
# define memcpy(dest, src, n) grn_memcpy(dest, src, n)
# include <msgpack.h>
# undef _CRT_SECURE_NO_WARNINGS
# undef memcpy

# if MSGPACK_VERSION_MAJOR < 1
typedef unsigned int msgpack_size_t;
Expand Down

2 comments on commit 7c408a2

@obache
Copy link
Contributor

@obache obache commented on 7c408a2 Jul 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change may cause another issues.
For example, if gcc with -fstack-protector already override memcpy with macros,
then redefined warnings will rise at build time,
stack protectors may be killed at runtime.

@kou
Copy link
Member Author

@kou kou commented on 7c408a2 Jul 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add defined(WIN32) check?

Please sign in to comment.