aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-05-11 10:29:34 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-05-11 10:29:34 +0200
commit188950472c19492547e298b27f9da0d72cf826df (patch)
tree218b802c52cfaada4d2d97431c757675a75a93a4
parent74b64180d67bb009d8d9ea1b6f18ad41aaa16396 (diff)
edid-decode: add VC++ support.
Suggested-by: Avernar <avernar@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--edid-decode.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/edid-decode.h b/edid-decode.h
index 4b1a93d..5b98c36 100644
--- a/edid-decode.h
+++ b/edid-decode.h
@@ -237,17 +237,34 @@ static inline void add_str(std::string &s, const std::string &add)
void msg(bool is_warn, const char *fmt, ...);
+#ifdef _WIN32
+
+#define warn(fmt, ...) msg(true, fmt, __VA_ARGS__)
+#define warn_once(fmt, ...) \
+ do { \
+ static bool shown_warn; \
+ if (!shown_warn) { \
+ shown_warn = true; \
+ msg(true, fmt, __VA_ARGS__); \
+ } \
+ } while (0)
+#define fail(fmt, ...) msg(false, fmt, __VA_ARGS__)
+
+#else
+
#define warn(fmt, args...) msg(true, fmt, ##args)
-#define warn_once(fmt, args...) \
- do { \
- static bool shown_warn; \
- if (!shown_warn) { \
- shown_warn = true; \
- msg(true, fmt, ##args); \
- } \
+#define warn_once(fmt, args...) \
+ do { \
+ static bool shown_warn; \
+ if (!shown_warn) { \
+ shown_warn = true; \
+ msg(true, fmt, ##args); \
+ } \
} while (0)
#define fail(fmt, args...) msg(false, fmt, ##args)
+#endif
+
void do_checksum(const char *prefix, const unsigned char *x, size_t len);
std::string utohex(unsigned char x);
std::string ouitohex(unsigned oui);

Privacy Policy