Compare commits

...

3 Commits

Author SHA1 Message Date
Marcus Nilsson
9699dfce07 Issue #40: Close file when it's no longer needed 2025-06-07 23:35:44 +00:00
Gary Wang
dff8906402 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>
2025-06-07 23:24:48 +00:00
Heiko Becker
6e163c978a CMake: Raise required version to 3.5
CMake >= 4.0.0-rc1 removed compatibility with versions < 3.5 and errors
out with such versions passed to cmake_minimum_required(). 3.5.0 has
been released 9 years ago, so I'd assume it's available almost everywhere.
2025-03-28 10:30:33 +01:00
4 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
######## Project settings
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.5)
include(CheckCCompilerFlag)
set (PACKAGE_NAME uchardet)
project (${PACKAGE_NAME} CXX C)

View File

@ -266,6 +266,7 @@ int main(int argc, char ** argv)
printf("%s: ", filename);
}
detect(handle, f, show_lang, verbose);
fclose(f);
}
uchardet_delete(handle);

View File

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

View File

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