Windows: pre-basic msvc support

This commit is contained in:
李通洲
2023-09-26 20:09:41 +08:00
parent 24a6efa227
commit 69373906ca
3 changed files with 15 additions and 1 deletions
+4
View File
@@ -14,6 +14,10 @@
#include "3rdparty/yyjson/yyjson.h"
#endif
#ifdef _MSC_VER
#define __attribute__(x)
#endif
#include "util/FFstrbuf.h"
#include "util/FFlist.h"
#include "util/platform/FFPlatform.h"
+6
View File
@@ -3,8 +3,14 @@
#ifndef FASTFETCH_INCLUDED_FFCHECKMACROS
#define FASTFETCH_INCLUDED_FFCHECKMACROS
#ifdef _MSC_VER
#include <sal.h>
#endif
#if defined(__GNUC__) || defined(__clang__)
#define FF_C_NODISCARD __attribute__((warn_unused_result))
#elif defined(_MSC_VER)
#define FF_C_NODISCARD _Check_return_
#else
#define FF_C_NODISCARD
#endif
+5 -1
View File
@@ -5,6 +5,10 @@
static inline void ffUnused(int dummy, ...) { (void) dummy; }
#define FF_UNUSED(...) ffUnused(0, __VA_ARGS__);
#define FF_MAYBE_UNUSED __attribute__ ((__unused__))
#if defined(__GNUC__) || defined(__clang__)
#define FF_MAYBE_UNUSED __attribute__ ((__unused__))
#else
#define FF_MAYBE_UNUSED
#endif
#endif