diff options
Diffstat (limited to 'src/boost/libs/log/config')
12 files changed, 265 insertions, 0 deletions
diff --git a/src/boost/libs/log/config/atomic-int32/Jamfile.jam b/src/boost/libs/log/config/atomic-int32/Jamfile.jam new file mode 100644 index 00000000..5b08d8d7 --- /dev/null +++ b/src/boost/libs/log/config/atomic-int32/Jamfile.jam @@ -0,0 +1,19 @@ +# +# Copyright Andrey Semashev 2016. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +import project ; +import log-platform-config ; + +project /boost/log/atomic-int32 + : source-location . + : requirements + <conditional>@log-platform-config.set-platform-defines + + <pch>off + ; + +obj atomic_int32 : atomic_int32.cpp ; diff --git a/src/boost/libs/log/config/atomic-int32/atomic_int32.cpp b/src/boost/libs/log/config/atomic-int32/atomic_int32.cpp new file mode 100644 index 00000000..f39bcc8f --- /dev/null +++ b/src/boost/libs/log/config/atomic-int32/atomic_int32.cpp @@ -0,0 +1,17 @@ +/* + * Copyright Andrey Semashev 2016. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#include <boost/atomic.hpp> + +#if !defined(BOOST_ATOMIC_INT32_LOCK_FREE) || (BOOST_ATOMIC_INT32_LOCK_FREE+0) != 2 +#error Boost.Log: Native 32-bit atomic operations are required but not supported by Boost.Atomic on the target platform +#endif + +int main(int, char*[]) +{ + return 0; +} diff --git a/src/boost/libs/log/config/message-compiler/Jamfile.jam b/src/boost/libs/log/config/message-compiler/Jamfile.jam new file mode 100644 index 00000000..37d98d10 --- /dev/null +++ b/src/boost/libs/log/config/message-compiler/Jamfile.jam @@ -0,0 +1,22 @@ +# +# Copyright Andrey Semashev 2007 - 2015. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +import project ; +import log-platform-config ; +using mc ; + +project /boost/log/message-compiler + : source-location ../../src + : requirements + <conditional>@log-platform-config.set-platform-defines + <pch>off + ; + +obj simple_event_log : windows/simple_event_log.mc ; + +# This test target verifies that Message Compiler (mc) is available and supported by the current toolset +alias test-availability : simple_event_log ; diff --git a/src/boost/libs/log/config/native-syslog/Jamfile.jam b/src/boost/libs/log/config/native-syslog/Jamfile.jam new file mode 100644 index 00000000..fa5dfcd0 --- /dev/null +++ b/src/boost/libs/log/config/native-syslog/Jamfile.jam @@ -0,0 +1,19 @@ +# +# Copyright Andrey Semashev 2016. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +import project ; +import log-platform-config ; + +project /boost/log/native-syslog + : source-location . + : requirements + <conditional>@log-platform-config.set-platform-defines + + <pch>off + ; + +obj native_syslog : native_syslog.cpp ; diff --git a/src/boost/libs/log/config/native-syslog/native_syslog.cpp b/src/boost/libs/log/config/native-syslog/native_syslog.cpp new file mode 100644 index 00000000..25605a68 --- /dev/null +++ b/src/boost/libs/log/config/native-syslog/native_syslog.cpp @@ -0,0 +1,26 @@ +/* + * Copyright Andrey Semashev 2016. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#include <syslog.h> + +int main(int, char*[]) +{ + ::openlog("test", LOG_NDELAY, LOG_USER); + + ::syslog(LOG_USER | LOG_DEBUG, "debug message"); + ::syslog(LOG_USER | LOG_INFO, "info message"); + ::syslog(LOG_USER | LOG_NOTICE, "notice message"); + ::syslog(LOG_USER | LOG_WARNING, "warning message"); + ::syslog(LOG_USER | LOG_ERR, "error message"); + ::syslog(LOG_USER | LOG_CRIT, "critical message"); + ::syslog(LOG_USER | LOG_ALERT, "alert message"); + ::syslog(LOG_USER | LOG_EMERG, "emergency message"); + + ::closelog(); + + return 0; +} diff --git a/src/boost/libs/log/config/pthread-mutex-robust/Jamfile.jam b/src/boost/libs/log/config/pthread-mutex-robust/Jamfile.jam new file mode 100644 index 00000000..6082e66e --- /dev/null +++ b/src/boost/libs/log/config/pthread-mutex-robust/Jamfile.jam @@ -0,0 +1,19 @@ +# +# Copyright Andrey Semashev 2015. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +import project ; +import log-platform-config ; + +project /boost/log/pthread-mutex-robust + : source-location . + : requirements + <conditional>@log-platform-config.set-platform-defines + + <pch>off + ; + +obj pthread_mutex_robust : pthread_mutex_robust.cpp ; diff --git a/src/boost/libs/log/config/pthread-mutex-robust/pthread_mutex_robust.cpp b/src/boost/libs/log/config/pthread-mutex-robust/pthread_mutex_robust.cpp new file mode 100644 index 00000000..36415aca --- /dev/null +++ b/src/boost/libs/log/config/pthread-mutex-robust/pthread_mutex_robust.cpp @@ -0,0 +1,37 @@ +/* + * Copyright Andrey Semashev 2015. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#include <errno.h> +#include <pthread.h> + +int main(int, char*[]) +{ + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL); + pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); + pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST); + + pthread_mutex_t m; + pthread_mutex_init(&m, &attr); + pthread_mutexattr_destroy(&attr); + + int err = pthread_mutex_lock(&m); + if (err == EOWNERDEAD) + { + err = pthread_mutex_consistent(&m); + } + + if (err != ENOTRECOVERABLE) + { + pthread_mutex_unlock(&m); + } + + pthread_mutex_destroy(&m); + + return 0; +} diff --git a/src/boost/libs/log/config/x86-ext/Jamfile.jam b/src/boost/libs/log/config/x86-ext/Jamfile.jam new file mode 100644 index 00000000..0e9695aa --- /dev/null +++ b/src/boost/libs/log/config/x86-ext/Jamfile.jam @@ -0,0 +1,34 @@ +# +# Copyright Andrey Semashev 2007 - 2015. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +import project ; + +project /boost/log/x86-extensions + : source-location . + : requirements + <pch>off + ; + +obj ssse3 : ssse3.cpp + : + <toolset>gcc:<cxxflags>"-msse -msse2 -msse3 -mssse3" + <toolset>clang:<cxxflags>"-msse -msse2 -msse3 -mssse3" + <toolset>intel-linux:<cxxflags>"-xSSSE3" + <toolset>intel-darwin:<cxxflags>"-xSSSE3" + <toolset>intel-win:<cxxflags>"/QxSSSE3" + ; + +obj avx2 : avx2.cpp + : + <toolset>gcc:<cxxflags>"-mavx -mavx2 -fabi-version=0" + <toolset>clang:<cxxflags>"-mavx -mavx2" + <toolset>intel-linux:<cxxflags>"-xCORE-AVX2 -fabi-version=0" + <toolset>intel-darwin:<cxxflags>"-xCORE-AVX2 -fabi-version=0" + <toolset>intel-win:<cxxflags>"/arch:CORE-AVX2" + <toolset>msvc:<cxxflags>"/arch:AVX" + ; + diff --git a/src/boost/libs/log/config/x86-ext/avx2.cpp b/src/boost/libs/log/config/x86-ext/avx2.cpp new file mode 100644 index 00000000..3ee051f1 --- /dev/null +++ b/src/boost/libs/log/config/x86-ext/avx2.cpp @@ -0,0 +1,20 @@ +/* + * Copyright Andrey Semashev 2007 - 2015. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#include <immintrin.h> + +void pretend_used(__m256i*); + +int main(int, char*[]) +{ + __m256i mm = _mm256_setzero_si256(); + pretend_used(&mm); + mm = _mm256_shuffle_epi8(_mm256_alignr_epi8(mm, mm, 10), mm); + pretend_used(&mm); + _mm256_zeroupper(); + return 0; +} diff --git a/src/boost/libs/log/config/x86-ext/ssse3.cpp b/src/boost/libs/log/config/x86-ext/ssse3.cpp new file mode 100644 index 00000000..4bcfe2bc --- /dev/null +++ b/src/boost/libs/log/config/x86-ext/ssse3.cpp @@ -0,0 +1,19 @@ +/* + * Copyright Andrey Semashev 2007 - 2015. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#include <tmmintrin.h> + +void pretend_used(__m128i*); + +int main(int, char*[]) +{ + __m128i mm = _mm_setzero_si128(); + pretend_used(&mm); + mm = _mm_shuffle_epi8(_mm_alignr_epi8(mm, mm, 10), mm); + pretend_used(&mm); + return 0; +} diff --git a/src/boost/libs/log/config/xopen-source-600/Jamfile.jam b/src/boost/libs/log/config/xopen-source-600/Jamfile.jam new file mode 100644 index 00000000..0d744dcf --- /dev/null +++ b/src/boost/libs/log/config/xopen-source-600/Jamfile.jam @@ -0,0 +1,16 @@ +# +# Copyright Andrey Semashev 2017. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +import project ; + +project /boost/log/xopen-source-600 + : source-location . + : requirements + <pch>off + ; + +obj xopen_source_600 : xopen_source_600.cpp ; diff --git a/src/boost/libs/log/config/xopen-source-600/xopen_source_600.cpp b/src/boost/libs/log/config/xopen-source-600/xopen_source_600.cpp new file mode 100644 index 00000000..1b26467c --- /dev/null +++ b/src/boost/libs/log/config/xopen-source-600/xopen_source_600.cpp @@ -0,0 +1,17 @@ +/* + * Copyright Andrey Semashev 2017. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +// Test if we can include system headers with -D_XOPEN_SOURCE=600 +#undef _XOPEN_SOURCE +#define _XOPEN_SOURCE 600 + +#include <unistd.h> + +int main(int, char*[]) +{ + return 0; +} |