Prefixed public variables

This commit is contained in:
Tsuda Kageyu
2013-05-02 23:03:13 +09:00
parent b0938a3cf1
commit 8f8ef3788f
8 changed files with 101 additions and 124 deletions

View File

@ -7,6 +7,28 @@ include(CheckTypeSize)
include(CheckCXXSourceCompiles)
include(TestBigEndian)
# Check if the size of integral types are suitable.
check_type_size("short" SIZEOF_SHORT)
if(NOT ${SIZEOF_SHORT} EQUAL 2)
MESSAGE(FATAL_ERROR "TagLib requires that short is 16-bit wide.")
endif()
check_type_size("int" SIZEOF_INT)
if(NOT ${SIZEOF_INT} EQUAL 4)
MESSAGE(FATAL_ERROR "TagLib requires that int is 32-bit wide.")
endif()
check_type_size("long long" SIZEOF_LONGLONG)
if(NOT ${SIZEOF_LONGLONG} EQUAL 8)
MESSAGE(FATAL_ERROR "TagLib requires that long long is 64-bit wide.")
endif()
check_type_size("wchar_t" SIZEOF_WCHAR_T)
if(${SIZEOF_WCHAR_T} LESS 2)
MESSAGE(FATAL_ERROR "TagLib requires that wchar_t is sufficient to store a UTF-16 char.")
endif()
# Determine the CPU byte order.
test_big_endian(TAGLIB_BIG_ENDIAN)
@ -15,13 +37,6 @@ if(NOT TAGLIB_BIG_ENDIAN)
set(TAGLIB_LITTLE_ENDIAN 1)
endif()
# Determine the size of integral types.
check_type_size("short" SIZEOF_SHORT)
check_type_size("int" SIZEOF_INT)
check_type_size("long long" SIZEOF_LONGLONG)
check_type_size("wchar_t" SIZEOF_WCHAR_T)
# Determine if your compiler supports std::wstring.
check_cxx_source_compiles("
@ -30,7 +45,7 @@ check_cxx_source_compiles("
std::wstring x(L\"ABC\");
return 0;
}
" HAVE_STD_WSTRING)
" TAGLIB_HAVE_STD_WSTRING)
# Determine which kind of atomic operations your compiler supports.
@ -42,9 +57,9 @@ check_cxx_source_compiles("
x.fetch_sub(1);
return 0;
}
" HAVE_STD_ATOMIC)
" TAGLIB_HAVE_STD_ATOMIC)
if(NOT HAVE_STD_ATOMIC)
if(NOT TAGLIB_HAVE_STD_ATOMIC)
check_cxx_source_compiles("
#include <boost/atomic.hpp>
int main() {
@ -53,9 +68,9 @@ if(NOT HAVE_STD_ATOMIC)
x.fetch_sub(1);
return 0;
}
" HAVE_BOOST_ATOMIC)
" TAGLIB_HAVE_BOOST_ATOMIC)
if(NOT HAVE_BOOST_ATOMIC)
if(NOT TAGLIB_HAVE_BOOST_ATOMIC)
check_cxx_source_compiles("
int main() {
volatile int x;
@ -63,9 +78,9 @@ if(NOT HAVE_STD_ATOMIC)
int y = __sync_sub_and_fetch(&x, 1);
return 0;
}
" HAVE_GCC_ATOMIC)
" TAGLIB_HAVE_GCC_ATOMIC)
if(NOT HAVE_GCC_ATOMIC)
if(NOT TAGLIB_HAVE_GCC_ATOMIC)
check_cxx_source_compiles("
#include <libkern/OSAtomic.h>
int main() {
@ -74,9 +89,9 @@ if(NOT HAVE_STD_ATOMIC)
int32_t y = OSAtomicDecrement32Barrier(&x);
return 0;
}
" HAVE_MAC_ATOMIC)
" TAGLIB_HAVE_MAC_ATOMIC)
if(NOT HAVE_MAC_ATOMIC)
if(NOT TAGLIB_HAVE_MAC_ATOMIC)
check_cxx_source_compiles("
#include <windows.h>
int main() {
@ -85,9 +100,9 @@ if(NOT HAVE_STD_ATOMIC)
LONG y = InterlockedDecrement(&x);
return 0;
}
" HAVE_WIN_ATOMIC)
" TAGLIB_HAVE_WIN_ATOMIC)
if(NOT HAVE_WIN_ATOMIC)
if(NOT TAGLIB_HAVE_WIN_ATOMIC)
check_cxx_source_compiles("
#include <ia64intrin.h>
int main() {
@ -96,7 +111,7 @@ if(NOT HAVE_STD_ATOMIC)
int y = __sync_sub_and_fetch(&x, 1);
return 0;
}
" HAVE_IA64_ATOMIC)
" TAGLIB_HAVE_IA64_ATOMIC)
endif()
endif()
endif()
@ -112,23 +127,23 @@ check_cxx_source_compiles("
__builtin_bswap16(0);
return 0;
}
" HAVE_GCC_BYTESWAP_16)
" TAGLIB_HAVE_GCC_BYTESWAP_16)
check_cxx_source_compiles("
int main() {
__builtin_bswap32(0);
return 0;
}
" HAVE_GCC_BYTESWAP_32)
" TAGLIB_HAVE_GCC_BYTESWAP_32)
check_cxx_source_compiles("
int main() {
__builtin_bswap64(0);
return 0;
}
" HAVE_GCC_BYTESWAP_64)
" TAGLIB_HAVE_GCC_BYTESWAP_64)
if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP_64)
if(NOT TAGLIB_HAVE_GCC_BYTESWAP_16 OR NOT TAGLIB_HAVE_GCC_BYTESWAP_32 OR NOT TAGLIB_HAVE_GCC_BYTESWAP_64)
check_cxx_source_compiles("
#include <byteswap.h>
int main() {
@ -137,9 +152,9 @@ if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP
__bswap_64(0);
return 0;
}
" HAVE_GLIBC_BYTESWAP)
" TAGLIB_HAVE_GLIBC_BYTESWAP)
if(NOT HAVE_GLIBC_BYTESWAP)
if(NOT TAGLIB_HAVE_GLIBC_BYTESWAP)
check_cxx_source_compiles("
#include <stdlib.h>
int main() {
@ -148,9 +163,9 @@ if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP
_byteswap_uint64(0);
return 0;
}
" HAVE_MSC_BYTESWAP)
" TAGLIB_HAVE_MSC_BYTESWAP)
if(NOT HAVE_MSC_BYTESWAP)
if(NOT TAGLIB_HAVE_MSC_BYTESWAP)
check_cxx_source_compiles("
#include <libkern/OSByteOrder.h>
int main() {
@ -159,9 +174,9 @@ if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP
OSSwapInt64(0);
return 0;
}
" HAVE_MAC_BYTESWAP)
" TAGLIB_HAVE_MAC_BYTESWAP)
if(NOT HAVE_MAC_BYTESWAP)
if(NOT TAGLIB_HAVE_MAC_BYTESWAP)
check_cxx_source_compiles("
#include <sys/endian.h>
int main() {
@ -170,7 +185,7 @@ if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP
swap64(0);
return 0;
}
" HAVE_OPENBSD_BYTESWAP)
" TAGLIB_HAVE_OPENBSD_BYTESWAP)
endif()
endif()
endif()
@ -184,15 +199,15 @@ check_cxx_source_compiles("
std::codecvt_utf8_utf16<wchar_t> x;
return 0;
}
" HAVE_STD_CODECVT)
" TAGLIB_HAVE_STD_CODECVT)
# Check for libz using the cmake supplied FindZLIB.cmake
find_package(ZLIB)
if(ZLIB_FOUND)
set(HAVE_ZLIB 1)
set(TAGLIB_HAVE_ZLIB 1)
else()
set(HAVE_ZLIB 0)
set(TAGLIB_HAVE_ZLIB 0)
endif()