mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 03:17:53 +00:00
Merge branch 'master' of github.com:cppformat/cppformat
This commit is contained in:
commit
6c656663f3
15
Android.mk
Normal file
15
Android.mk
Normal file
@ -0,0 +1,15 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := cppformat_static
|
||||
LOCAL_MODULE_FILENAME := libcppformat
|
||||
|
||||
LOCAL_SRC_FILES := format.cc
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
|
||||
|
||||
LOCAL_CFLAGS += -std=c++11 -fexceptions
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
@ -117,6 +117,24 @@ endif ()
|
||||
# add_definitions(-DFMT_USE_NOEXCEPT=1)
|
||||
#endif ()
|
||||
|
||||
#check_cxx_source_compiles("
|
||||
# struct C{
|
||||
# C()=delete;
|
||||
# C(const C&)=delete;
|
||||
# C& operator=(const C&)=delete;
|
||||
# };
|
||||
# int main(){}" FMT_DELETED_FUNCTIONS)
|
||||
#if (FMT_DELETED_FUNCTIONS)
|
||||
# add_definitions(-DFMT_USE_DELETED_FUNCTIONS=1)
|
||||
#endif ()
|
||||
|
||||
#check_cxx_source_compiles("
|
||||
# static_assert(true, \"\");
|
||||
# int main(){}" FMT_STATIC_ASSERT)
|
||||
#if (FMT_STATIC_ASSERT)
|
||||
# add_definitions(-DFMT_USE_STATIC_ASSERT=1)
|
||||
#endif ()
|
||||
|
||||
# GTest doesn't detect <tuple> with clang.
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_definitions(gmock PUBLIC GTEST_USE_OWN_TR1_TUPLE=1)
|
||||
|
@ -238,9 +238,8 @@ Tinyformat
|
||||
|
||||
This library supports printf-like format strings and is very small and
|
||||
fast. Unfortunately it doesn't support positional arguments and wrapping
|
||||
it in C++98 is somewhat difficult. However if you only need a type-safe
|
||||
printf replacement with support for user-defined types, I highly recommend
|
||||
this library.
|
||||
it in C++98 is somewhat difficult. Also its performance and code compactness
|
||||
are limited by IOStreams.
|
||||
|
||||
Boost Spirit.Karma
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
22
format.h
22
format.h
@ -56,6 +56,9 @@
|
||||
// many valid cases.
|
||||
# pragma GCC diagnostic ignored "-Wshadow"
|
||||
# endif
|
||||
# if __cplusplus >= 201103L || defined __GXX_EXPERIMENTAL_CXX0X__
|
||||
# define FMT_HAS_GXX_CXX11 1
|
||||
# endif
|
||||
#else
|
||||
# define FMT_GCC_EXTENSION
|
||||
#endif
|
||||
@ -92,7 +95,7 @@
|
||||
// since version 2013.
|
||||
# define FMT_USE_VARIADIC_TEMPLATES \
|
||||
(FMT_HAS_FEATURE(cxx_variadic_templates) || \
|
||||
(FMT_GCC_VERSION >= 404 && __cplusplus >= 201103) || _MSC_VER >= 1800)
|
||||
(FMT_GCC_VERSION >= 404 && FMT_HAS_GXX_CXX11) || _MSC_VER >= 1800)
|
||||
#endif
|
||||
|
||||
#ifndef FMT_USE_RVALUE_REFERENCES
|
||||
@ -103,7 +106,7 @@
|
||||
# else
|
||||
# define FMT_USE_RVALUE_REFERENCES \
|
||||
(FMT_HAS_FEATURE(cxx_rvalue_references) || \
|
||||
(FMT_GCC_VERSION >= 403 && __cplusplus >= 201103) || _MSC_VER >= 1600)
|
||||
(FMT_GCC_VERSION >= 403 && FMT_HAS_GXX_CXX11) || _MSC_VER >= 1600)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -113,7 +116,7 @@
|
||||
|
||||
// Define FMT_USE_NOEXCEPT to make C++ Format use noexcept (C++11 feature).
|
||||
#if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \
|
||||
(FMT_GCC_VERSION >= 408 && __cplusplus >= 201103)
|
||||
(FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11)
|
||||
# define FMT_NOEXCEPT noexcept
|
||||
#else
|
||||
# define FMT_NOEXCEPT throw()
|
||||
@ -121,9 +124,16 @@
|
||||
|
||||
// A macro to disallow the copy constructor and operator= functions
|
||||
// This should be used in the private: declarations for a class
|
||||
#define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||
TypeName(const TypeName&); \
|
||||
void operator=(const TypeName&)
|
||||
#if FMT_USE_DELETED_FUNCTIONS || FMT_HAS_FEATURE(cxx_deleted_functions) || \
|
||||
(FMT_GCC_VERSION >= 404 && FMT_HAS_GXX_CXX11) || _MSC_VER >= 1800
|
||||
# define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||
TypeName(const TypeName&) = delete; \
|
||||
TypeName& operator=(const TypeName&) = delete
|
||||
#else
|
||||
# define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||
TypeName(const TypeName&); \
|
||||
TypeName& operator=(const TypeName&)
|
||||
#endif
|
||||
|
||||
namespace fmt {
|
||||
|
||||
|
3
posix.h
3
posix.h
@ -68,7 +68,8 @@
|
||||
# define FMT_UNUSED
|
||||
#endif
|
||||
|
||||
#if FMT_USE_STATIC_ASSERT
|
||||
#if FMT_USE_STATIC_ASSERT || FMT_HAS_CPP_ATTRIBUTE(cxx_static_assert) || \
|
||||
(FMT_GCC_VERSION >= 403 && FMT_HAS_GXX_CXX11) || _MSC_VER >= 1600
|
||||
# define FMT_STATIC_ASSERT(cond, message) static_assert(cond, message)
|
||||
#else
|
||||
# define FMT_CONCAT_(a, b) FMT_CONCAT(a, b)
|
||||
|
Loading…
Reference in New Issue
Block a user