fix: FTBFS under MSVC

1. __declspec(deprecated) is okay for MSVC
2. strcasecmp is POSIX-only, _stricmp should be used for MSVC

Co-authored-by: yyc12345 <yyc12321@outlook.com>
This commit is contained in:
Gary Wang 2024-09-22 16:16:22 +08:00 committed by Jehan Pagès
parent 6e163c978a
commit dff8906402
2 changed files with 5 additions and 1 deletions

View File

@ -59,7 +59,7 @@ extern "C" {
#elif defined(__GNUC__) || defined(__clang__) #elif defined(__GNUC__) || defined(__clang__)
#define DEPRECATED(message) __attribute__ ((deprecated)) #define DEPRECATED(message) __attribute__ ((deprecated))
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#define DEPRECATED(message) __declspec(deprecated) func #define DEPRECATED(message) __declspec(deprecated)
#else #else
#warning("DEPRECATED macro not available") #warning("DEPRECATED macro not available")
#define DEPRECATED(message) #define DEPRECATED(message)

View File

@ -46,6 +46,10 @@
#define BUFFER_SIZE 65536 #define BUFFER_SIZE 65536
#ifdef _MSC_VER
#define strcasecmp _stricmp
#endif
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32) || defined(__CYGWIN__)
#define realpath(filename,unused) _fullpath(NULL, filename, 0) #define realpath(filename,unused) _fullpath(NULL, filename, 0)
#define SEP '\\' #define SEP '\\'