From d0fc26f91a0141b56a0550741219c3dc43630e03 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 3 Oct 2021 14:42:53 +0300 Subject: [PATCH] Do not pretend that windows is supported (remove code undef #ifdef _MSC_VER) --- base/base/defines.h | 31 ++++++++----------------------- base/base/demangle.cpp | 18 ------------------ base/base/mremap.cpp | 8 -------- base/base/mremap.h | 2 -- 4 files changed, 8 insertions(+), 51 deletions(-) diff --git a/base/base/defines.h b/base/base/defines.h index a736c246d73..aef901d3148 100644 --- a/base/base/defines.h +++ b/base/base/defines.h @@ -15,33 +15,18 @@ # define ch_has_feature __has_feature #endif -#if defined(_MSC_VER) -# if !defined(likely) -# define likely(x) (x) -# endif -# if !defined(unlikely) -# define unlikely(x) (x) -# endif -#else -# if !defined(likely) -# define likely(x) (__builtin_expect(!!(x), 1)) -# endif -# if !defined(unlikely) -# define unlikely(x) (__builtin_expect(!!(x), 0)) -# endif +#if !defined(likely) +# define likely(x) (__builtin_expect(!!(x), 1)) +#endif +#if !defined(unlikely) +# define unlikely(x) (__builtin_expect(!!(x), 0)) #endif // more aliases: https://mailman.videolan.org/pipermail/x264-devel/2014-May/010660.html -#if defined(_MSC_VER) -# define ALWAYS_INLINE __forceinline -# define NO_INLINE static __declspec(noinline) -# define MAY_ALIAS -#else -# define ALWAYS_INLINE __attribute__((__always_inline__)) -# define NO_INLINE __attribute__((__noinline__)) -# define MAY_ALIAS __attribute__((__may_alias__)) -#endif +#define ALWAYS_INLINE __attribute__((__always_inline__)) +#define NO_INLINE __attribute__((__noinline__)) +#define MAY_ALIAS __attribute__((__may_alias__)) #if !defined(__x86_64__) && !defined(__aarch64__) && !defined(__PPC__) # error "The only supported platforms are x86_64 and AArch64, PowerPC (work in progress)" diff --git a/base/base/demangle.cpp b/base/base/demangle.cpp index 97906293bca..54bb075be4d 100644 --- a/base/base/demangle.cpp +++ b/base/base/demangle.cpp @@ -1,20 +1,5 @@ #include -#if defined(_MSC_VER) - -DemangleResult tryDemangle(const char *) -{ - return DemangleResult{}; -} - -std::string demangle(const char * name, int & status) -{ - status = 0; - return name; -} - -#else - #include #include @@ -39,6 +24,3 @@ std::string demangle(const char * name, int & status) return name; } - - -#endif diff --git a/base/base/mremap.cpp b/base/base/mremap.cpp index ebf6c6e0249..e2ca4701b7f 100644 --- a/base/base/mremap.cpp +++ b/base/base/mremap.cpp @@ -19,22 +19,14 @@ void * mremap_fallback( return MAP_FAILED; } -#if defined(_MSC_VER) - void * new_address = ::operator new(new_size); -#else void * new_address = mmap(nullptr, new_size, mmap_prot, mmap_flags, mmap_fd, mmap_offset); if (MAP_FAILED == new_address) return MAP_FAILED; -#endif memcpy(new_address, old_address, old_size); -#if defined(_MSC_VER) - delete old_address; -#else if (munmap(old_address, old_size)) abort(); -#endif return new_address; } diff --git a/base/base/mremap.h b/base/base/mremap.h index f488393278a..7a5b03e7c31 100644 --- a/base/base/mremap.h +++ b/base/base/mremap.h @@ -2,9 +2,7 @@ #include #include -#if !defined(_MSC_VER) #include -#endif #ifdef MREMAP_MAYMOVE