diff options
author | Alan Antonuk <alan.antonuk@gmail.com> | 2015-06-02 21:05:26 -0700 |
---|---|---|
committer | Alan Antonuk <alan.antonuk@gmail.com> | 2015-06-02 21:54:00 -0700 |
commit | 45caaefb97a09ef41881e69203b30433c1f2069e (patch) | |
tree | 56ad57857c3290477237e876c998cb60427a2aa5 /tests | |
parent | 5a11ca8e8d22b4c821de7efe7449fe08f0bcd428 (diff) | |
download | rabbitmq-c-45caaefb97a09ef41881e69203b30433c1f2069e.tar.gz |
Win32: fixup a few MSVC warnings in test & examples
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_parse_url.c | 5 | ||||
-rw-r--r-- | tests/test_tables.c | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/tests/test_parse_url.c b/tests/test_parse_url.c index cb4f59d..b54ace2 100644 --- a/tests/test_parse_url.c +++ b/tests/test_parse_url.c @@ -36,6 +36,11 @@ #include "config.h" +#ifdef _MSC_VER +/* MSVC complains about strdup being deprecated in favor of _strdup */ +# define _CRT_NONSTDC_NO_DEPRECATE +#endif + #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/tests/test_tables.c b/tests/test_tables.c index cf2509e..cc40410 100644 --- a/tests/test_tables.c +++ b/tests/test_tables.c @@ -34,6 +34,11 @@ * ***** END LICENSE BLOCK ***** */ +#ifdef _MSC_VER +# define _USE_MATH_DEFINES +# define _CRT_SECURE_NO_WARNINGS +#endif + #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -44,9 +49,6 @@ #include <amqp.h> -#ifdef _MSC_VER -#define _USE_MATH_DEFINES -#endif #include <math.h> void die(const char *fmt, ...) @@ -339,7 +341,7 @@ static void test_table_codec(FILE *out) entries[12].key = amqp_cstring_bytes("float"); entries[12].value.kind = AMQP_FIELD_KIND_F32; - entries[12].value.value.f32 = M_PI; + entries[12].value.value.f32 = (float)M_PI; entries[13].key = amqp_cstring_bytes("double"); entries[13].value.kind = AMQP_FIELD_KIND_F64; |