Commit 0bed63c8 authored by captainwong's avatar captainwong

NOMINMAX

parent d1b29132
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#endif #endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files // Windows Header Files
#include <windows.h> #include <windows.h>
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
# ifndef _WINSOCK_DEPRECATED_NO_WARNINGS # ifndef _WINSOCK_DEPRECATED_NO_WARNINGS
# define _WINSOCK_DEPRECATED_NO_WARNINGS # define _WINSOCK_DEPRECATED_NO_WARNINGS
# endif # endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <WinSock2.h> #include <WinSock2.h>
#pragma comment(lib, "ws2_32.lib") #pragma comment(lib, "ws2_32.lib")
#endif #endif
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
#ifndef _CRT_SECURE_NO_WARNINGS #ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#endif #endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files // Windows Header Files
#include <windows.h> #include <windows.h>
......
#ifdef _WIN32 #ifdef _WIN32
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#define _WINSOCK_DEPRECATED_NO_WARNINGS #define _WINSOCK_DEPRECATED_NO_WARNINGS
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <WinSock2.h> #include <WinSock2.h>
#pragma comment(lib, "ws2_32.lib") #pragma comment(lib, "ws2_32.lib")
#define ioctl ioctlsocket #define ioctl ioctlsocket
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
# ifndef _CRT_SECURE_NO_WARNINGS # ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS # define _CRT_SECURE_NO_WARNINGS
# endif # endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <WinSock2.h> #include <WinSock2.h>
#pragma comment(lib, "ws2_32.lib") #pragma comment(lib, "ws2_32.lib")
#endif #endif
......
...@@ -46,14 +46,6 @@ static inline int localtime_r(time_t* t, struct tm* tm_time) { ...@@ -46,14 +46,6 @@ static inline int localtime_r(time_t* t, struct tm* tm_time) {
return localtime_s(tm_time, t); return localtime_s(tm_time, t);
} }
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
#endif // __GNUG__ #endif // __GNUG__
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#endif #endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <stdint.h> #include <stdint.h>
#ifdef ENABLE_ADEMCO_EVENT_TO_STRING #ifdef ENABLE_ADEMCO_EVENT_TO_STRING
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <string> #include <string>
#include <memory> #include <memory>
#include <iterator> #include <iterator>
#include <algorithm>
namespace ademco namespace ademco
{ {
...@@ -1234,8 +1235,8 @@ struct AdemcoPacket ...@@ -1234,8 +1235,8 @@ struct AdemcoPacket
} }
// dump data // dump data
JLOG_HEX(pack, pack_len); JLOG_HEX(pack, std::min(pack_len, 4096u));
JLOG_ASC(pack, pack_len); JLOG_ASC(pack, std::min(pack_len, 4096u));
assert(0); assert(0);
return ParseResult::RESULT_DATA_ERROR; return ParseResult::RESULT_DATA_ERROR;
......
#pragma once #pragma once
#include "ademco_packet.h"
#include <assert.h> #include <assert.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
...@@ -7,7 +8,6 @@ ...@@ -7,7 +8,6 @@
#include <string> #include <string>
#include <type_traits> #include <type_traits>
#include <iterator> #include <iterator>
#include "ademco_packet.h"
namespace hb namespace hb
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment