├── .clang-format ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── LICENSE ├── README.md ├── bztree.cc ├── bztree.h ├── tests ├── bztree_multithread_tests.cc ├── bztree_pibench_wrapper.cc ├── bztree_pibench_wrapper.h ├── bztree_pmdk_tests.cc └── bztree_tests.cc └── third-party ├── cpplint ├── README ├── cpplint.py ├── cpplint.pyc ├── cpplint_test_header.h ├── cpplint_unittest.py └── nested │ └── cpplint_test_header.h ├── gflags-2.1.2 ├── compiled │ └── gflags │ │ └── include │ │ └── gflags │ │ ├── config.h │ │ ├── gflags.h │ │ ├── gflags_completions.h │ │ ├── gflags_declare.h │ │ └── gflags_gflags.h └── gflags │ ├── .gitattributes │ ├── .gitignore │ ├── .gitmodules │ ├── AUTHORS.txt │ ├── CMakeLists.txt │ ├── COPYING.txt │ ├── ChangeLog.txt │ ├── INSTALL.md │ ├── README.md │ ├── cmake │ ├── README_runtime.txt │ ├── config.cmake.in │ ├── execute_test.cmake │ ├── package.cmake.in │ ├── utils.cmake │ └── version.cmake.in │ ├── src │ ├── config.h.in │ ├── gflags.cc │ ├── gflags.h.in │ ├── gflags_completions.cc │ ├── gflags_completions.h.in │ ├── gflags_completions.sh │ ├── gflags_declare.h.in │ ├── gflags_ns.h.in │ ├── gflags_reporting.cc │ ├── mutex.h │ ├── util.h │ ├── windows_port.cc │ └── windows_port.h │ └── test │ ├── CMakeLists.txt │ ├── config │ ├── CMakeLists.txt │ └── main.cc │ ├── config_for_unittests.h │ ├── flagfile.1 │ ├── flagfile.2 │ ├── flagfile.3 │ ├── gflags_build.py.in │ ├── gflags_declare_flags.cc │ ├── gflags_declare_test.cc │ ├── gflags_strip_flags_test.cc │ ├── gflags_strip_flags_test.cmake │ ├── gflags_unittest.cc │ ├── gflags_unittest_flagfile │ └── nc │ ├── CMakeLists.txt │ └── gflags_nc.cc └── glog-0.3.4 ├── .gitignore ├── AUTHORS ├── CMakeLists.txt ├── CONTRIBUTING.md ├── CONTRIBUTORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── README.windows ├── aclocal.m4 ├── cmake └── DetermineGflagsNamespace.cmake ├── compile ├── config.guess ├── config.sub ├── configure ├── configure.ac ├── depcomp ├── doc ├── designstyle.css └── glog.html ├── glog-config.cmake.in ├── google-glog.sln ├── install-sh ├── libglog.pc.in ├── ltmain.sh ├── m4 ├── ac_have_attribute.m4 ├── ac_have_builtin_expect.m4 ├── ac_have_sync_val_compare_and_swap.m4 ├── ac_rwlock.m4 ├── acx_pthread.m4 ├── google_namespace.m4 ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 ├── lt~obsolete.m4 ├── namespaces.m4 ├── pc_from_ucontext.m4 ├── stl_namespace.m4 └── using_operator.m4 ├── missing ├── mkinstalldirs ├── packages ├── deb.sh ├── deb │ ├── README │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── docs │ ├── libgoogle-glog-dev.dirs │ ├── libgoogle-glog-dev.install │ ├── libgoogle-glog0.dirs │ ├── libgoogle-glog0.install │ └── rules ├── rpm.sh └── rpm │ └── rpm.spec ├── src ├── base │ ├── commandlineflags.h │ ├── googleinit.h │ └── mutex.h ├── config.h.cmake.in ├── config.h.in ├── config_for_unittests.h ├── demangle.cc ├── demangle.h ├── demangle_unittest.cc ├── demangle_unittest.sh ├── demangle_unittest.txt ├── glog │ ├── log_severity.h │ ├── logging.h.in │ ├── raw_logging.h.in │ ├── stl_logging.h.in │ └── vlog_is_on.h.in ├── googletest.h ├── logging.cc ├── logging_striplog_test.sh ├── logging_striptest10.cc ├── logging_striptest2.cc ├── logging_striptest_main.cc ├── logging_unittest.cc ├── logging_unittest.err ├── mock-log.h ├── mock-log_test.cc ├── raw_logging.cc ├── signalhandler.cc ├── signalhandler_unittest.cc ├── signalhandler_unittest.sh ├── stacktrace.h ├── stacktrace_generic-inl.h ├── stacktrace_libunwind-inl.h ├── stacktrace_powerpc-inl.h ├── stacktrace_unittest.cc ├── stacktrace_x86-inl.h ├── stacktrace_x86_64-inl.h ├── stl_logging_unittest.cc ├── symbolize.cc ├── symbolize.h ├── symbolize_unittest.cc ├── utilities.cc ├── utilities.h ├── utilities_unittest.cc ├── vlog_is_on.cc └── windows │ ├── config.h │ ├── glog │ ├── log_severity.h │ ├── logging.h │ ├── raw_logging.h │ ├── stl_logging.h │ └── vlog_is_on.h │ ├── port.cc │ ├── port.h │ └── preprocess.sh ├── test-driver └── vsprojects ├── libglog └── libglog.vcproj ├── libglog_static └── libglog_static.vcproj ├── logging_unittest └── logging_unittest.vcproj └── logging_unittest_static └── logging_unittest_static.vcproj /.clang-format: -------------------------------------------------------------------------------- 1 | # Use the Google style in this project. 2 | BasedOnStyle: Google -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### C++ template 3 | # Prerequisites 4 | *.d 5 | 6 | # Compiled Object files 7 | *.slo 8 | *.lo 9 | *.o 10 | *.obj 11 | 12 | # Precompiled Headers 13 | *.gch 14 | *.pch 15 | 16 | # Compiled Dynamic libraries 17 | *.so 18 | *.dylib 19 | *.dll 20 | 21 | # Fortran module files 22 | *.mod 23 | *.smod 24 | 25 | # Compiled Static libraries 26 | *.lai 27 | *.la 28 | *.a 29 | *.lib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | 36 | # IDE related things 37 | cmake-build* 38 | .idea 39 | .vscode 40 | build 41 | release 42 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third-party/googletest"] 2 | path = third-party/googletest 3 | url = https://github.com/google/googletest.git 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018-2019 Xiangpeng Hao and Tianzheng Wang, Simon Fraser University. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BzTree 2 | An open-source [BzTree](https://dl.acm.org/citation.cfm?id=3164147) implementation, used in our [VLDB paper](http://www.vldb.org/pvldb/vol13/p574-lersch.pdf): 3 | 4 | ``` 5 | Lucas Lersch, Xiangpeng Hao, Ismail Oukid, Tianzheng Wang, Thomas Willhalm: 6 | Evaluating Persistent Memory Range Indexes. PVLDB 13(4): 574-587 (2019) 7 | ``` 8 | 9 | ## Build 10 | 11 | ### Use PMDK 12 | 13 | ```bash 14 | mkdir build & cd build 15 | cmake -DPMEM_BACKEND=PMDK .. 16 | ``` 17 | 18 | ### Volatile only 19 | 20 | ```bash 21 | mkdir build & cd build 22 | cmake -DPMEM_BACKEND=VOLATILE .. 23 | ``` 24 | 25 | #### Other build options 26 | `-DPMEM_BACKEND=EMU` to emulate persistent memory using DRAM 27 | 28 | `-DGOOGLE_FRAMEWORK=0` if you're not comfortable with google frameworks (gtest/glog/gflags) 29 | 30 | `-DBUILD_TESTS=0` to build shared library only (without tests) 31 | 32 | `-DMAX_FREEZE_RETRY=n` to set max freeze retry times, default to 1, check the original paper for details 33 | 34 | `-DENABLE_MERGE=1` to enable merge after delete, this is disabled by default, check the original paper for details. 35 | 36 | ## Benchmark on PiBench 37 | 38 | We officially support bztree wrapper for pibench: 39 | 40 | ```bash 41 | make bztree_pibench_wrapper -j 42 | ``` 43 | 44 | Checkout PiBench here: https://github.com/wangtzh/pibench 45 | 46 | ### Build/Create BzTree shared lib 47 | 48 | ```bash 49 | mkdir Release & cd Release 50 | cmake -DCMAKE_BUILD_TYPE=Release -DPMEM_BACKEND=${BACKEND} -DGOOGLE_FRAMEWORK=0 -DBUILD_TESTS=0 .. 51 | ``` 52 | -------------------------------------------------------------------------------- /tests/bztree_pibench_wrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // A wrapper for the Bz-Tree 3 | 4 | #include "tree_api.hpp" 5 | #include "../bztree.h" 6 | 7 | class bztree_wrapper : public tree_api 8 | { 9 | public: 10 | bztree_wrapper(const tree_options_t &opt); 11 | virtual ~bztree_wrapper(); 12 | 13 | virtual bool find(const char *key, size_t key_sz, char *value_out) override; 14 | virtual bool insert(const char *key, size_t key_sz, const char *value, size_t value_sz) override; 15 | virtual bool update(const char *key, size_t key_sz, const char *value, size_t value_sz) override; 16 | virtual bool remove(const char *key, size_t key_sz) override; 17 | virtual int scan(const char *key, size_t key_sz, int scan_sz, char *&values_out) override; 18 | 19 | bool recovery(const tree_options_t &opt); 20 | 21 | private: 22 | bztree::BzTree *tree_; 23 | }; 24 | -------------------------------------------------------------------------------- /third-party/cpplint/README: -------------------------------------------------------------------------------- 1 | This is automated checker to make sure a C++ file follows Google's C++ style 2 | guide (https://google.github.io/styleguide/cppguide.html). As it 3 | heavily relies on regular expressions, cpplint.py won't catch all violations of 4 | the style guide and will very occasionally report a false positive. There is a 5 | list of things we currently don't handle very well at the top of cpplint.py, 6 | and we welcome patches to improve it. 7 | 8 | The linting tool takes a list of files as input. For full usage instructions, 9 | please see the output of: 10 | 11 | ./cpplint.py --help 12 | 13 | Unit tests are provided in cpplint_unittest.py. This file can safely be ignored 14 | by end users who have downloaded this package and only want to run the lint 15 | tool. 16 | 17 | --- 18 | 19 | cpplint.py and its corresponding unit tests are Copyright (C) 2009 Google Inc. 20 | 21 | Redistribution and use in source and binary forms, with or without 22 | modification, are permitted provided that the following conditions are 23 | met: 24 | 25 | * Redistributions of source code must retain the above copyright 26 | notice, this list of conditions and the following disclaimer. 27 | * Redistributions in binary form must reproduce the above 28 | copyright notice, this list of conditions and the following disclaimer 29 | in the documentation and/or other materials provided with the 30 | distribution. 31 | * Neither the name of Google Inc. nor the names of its 32 | contributors may be used to endorse or promote products derived from 33 | this software without specific prior written permission. 34 | 35 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 36 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 37 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 38 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 39 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 42 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 43 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 44 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 45 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 46 | -------------------------------------------------------------------------------- /third-party/cpplint/cpplint.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfu-dis/bztree/b2e7fcb5c70ac79b577a1d0e5d30a4b6207d6464/third-party/cpplint/cpplint.pyc -------------------------------------------------------------------------------- /third-party/cpplint/cpplint_test_header.h: -------------------------------------------------------------------------------- 1 | // A test header for cpplint_unittest.py. 2 | -------------------------------------------------------------------------------- /third-party/cpplint/nested/cpplint_test_header.h: -------------------------------------------------------------------------------- 1 | // A test header for cpplint_unittest.py. 2 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/compiled/gflags/include/gflags/config.h: -------------------------------------------------------------------------------- 1 | /* Generated from config.h.in during build configuration using CMake. */ 2 | 3 | // Note: This header file is only used internally. It is not part of public interface! 4 | 5 | // --------------------------------------------------------------------------- 6 | // System checks 7 | 8 | // Define if you build this library for a MS Windows OS. 9 | #define OS_WINDOWS 10 | 11 | // Define if you have the header file. 12 | #define HAVE_STDINT_H 13 | 14 | // Define if you have the header file. 15 | #define HAVE_SYS_TYPES_H 16 | 17 | // Define if you have the header file. 18 | /* #undef HAVE_INTTYPES_H */ 19 | 20 | // Define if you have the header file. 21 | #define HAVE_SYS_STAT_H 22 | 23 | // Define if you have the header file. 24 | /* #undef HAVE_UNISTD_H */ 25 | 26 | // Define if you have the header file. 27 | /* #undef HAVE_FNMATCH_H */ 28 | 29 | // Define if you have the header file (Windows 2000/XP). 30 | #define HAVE_SHLWAPI_H 31 | 32 | // Define if you have the strtoll function. 33 | /* #undef HAVE_STRTOLL */ 34 | 35 | // Define if you have the strtoq function. 36 | /* #undef HAVE_STRTOQ */ 37 | 38 | // Define if you have the header file. 39 | /* #undef HAVE_PTHREAD */ 40 | 41 | // Define if your pthread library defines the type pthread_rwlock_t 42 | /* #undef HAVE_RWLOCK */ 43 | 44 | // gcc requires this to get PRId64, etc. 45 | #if defined(HAVE_INTTYPES_H) && !defined(__STDC_FORMAT_MACROS) 46 | # define __STDC_FORMAT_MACROS 1 47 | #endif 48 | 49 | // --------------------------------------------------------------------------- 50 | // Package information 51 | 52 | // Name of package. 53 | #define PACKAGE gflags 54 | 55 | // Define to the full name of this package. 56 | #define PACKAGE_NAME gflags 57 | 58 | // Define to the full name and version of this package. 59 | #define PACKAGE_STRING gflags 2.2.0 60 | 61 | // Define to the one symbol short name of this package. 62 | #define PACKAGE_TARNAME gflags-2.2.0 63 | 64 | // Define to the version of this package. 65 | #define PACKAGE_VERSION 2.2.0 66 | 67 | // Version number of package. 68 | #define VERSION PACKAGE_VERSION 69 | 70 | // Define to the address where bug reports for this package should be sent. 71 | #define PACKAGE_BUGREPORT https://github.com/schuhschuh/gflags/issues 72 | 73 | // --------------------------------------------------------------------------- 74 | // Path separator 75 | #ifndef PATH_SEPARATOR 76 | # ifdef OS_WINDOWS 77 | # define PATH_SEPARATOR '\\' 78 | # else 79 | # define PATH_SEPARATOR '/' 80 | # endif 81 | #endif 82 | 83 | // --------------------------------------------------------------------------- 84 | // Windows 85 | 86 | // Whether gflags library is a DLL. 87 | #ifndef GFLAGS_IS_A_DLL 88 | # define GFLAGS_IS_A_DLL 0 89 | #endif 90 | 91 | // Always export symbols when compiling a shared library as this file is only 92 | // included by internal modules when building the gflags library itself. 93 | // The gflags_declare.h header file will set it to import these symbols otherwise. 94 | #ifndef GFLAGS_DLL_DECL 95 | # if GFLAGS_IS_A_DLL && defined(_MSC_VER) 96 | # define GFLAGS_DLL_DECL __declspec(dllexport) 97 | # else 98 | # define GFLAGS_DLL_DECL 99 | # endif 100 | #endif 101 | // Flags defined by the gflags library itself must be exported 102 | #ifndef GFLAGS_DLL_DEFINE_FLAG 103 | # define GFLAGS_DLL_DEFINE_FLAG GFLAGS_DLL_DECL 104 | #endif 105 | 106 | #ifdef OS_WINDOWS 107 | // The unittests import the symbols of the shared gflags library 108 | # if GFLAGS_IS_A_DLL && defined(_MSC_VER) 109 | # define GFLAGS_DLL_DECL_FOR_UNITTESTS __declspec(dllimport) 110 | # endif 111 | # include "windows_port.h" 112 | #endif 113 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/compiled/gflags/include/gflags/gflags_declare.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 1999, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // --- 31 | // 32 | // Revamped and reorganized by Craig Silverstein 33 | // 34 | // This is the file that should be included by any file which declares 35 | // command line flag. 36 | 37 | #ifndef GFLAGS_DECLARE_H_ 38 | #define GFLAGS_DECLARE_H_ 39 | 40 | 41 | // --------------------------------------------------------------------------- 42 | // Namespace of gflags library symbols. 43 | #define GFLAGS_NAMESPACE gflags 44 | 45 | // --------------------------------------------------------------------------- 46 | // Windows DLL import/export. 47 | 48 | // We always want to import the symbols of the gflags library 49 | #ifndef GFLAGS_DLL_DECL 50 | # if 0 && defined(_MSC_VER) 51 | # define GFLAGS_DLL_DECL __declspec(dllimport) 52 | # else 53 | # define GFLAGS_DLL_DECL 54 | # endif 55 | #endif 56 | 57 | // We always want to import variables declared in user code 58 | #ifndef GFLAGS_DLL_DECLARE_FLAG 59 | # ifdef _MSC_VER 60 | # define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport) 61 | # else 62 | # define GFLAGS_DLL_DECLARE_FLAG 63 | # endif 64 | #endif 65 | 66 | // --------------------------------------------------------------------------- 67 | // Flag types 68 | #include 69 | #if 1 70 | # include // the normal place uint32_t is defined 71 | #elif 1 72 | # include // the normal place u_int32_t is defined 73 | #elif 0 74 | # include // a third place for uint32_t or u_int32_t 75 | #endif 76 | 77 | namespace GFLAGS_NAMESPACE { 78 | 79 | #if 0 // C99 80 | typedef int32_t int32; 81 | typedef uint32_t uint32; 82 | typedef int64_t int64; 83 | typedef uint64_t uint64; 84 | #elif 0 // BSD 85 | typedef int32_t int32; 86 | typedef u_int32_t uint32; 87 | typedef int64_t int64; 88 | typedef u_int64_t uint64; 89 | #elif 1 // Windows 90 | typedef __int32 int32; 91 | typedef unsigned __int32 uint32; 92 | typedef __int64 int64; 93 | typedef unsigned __int64 uint64; 94 | #else 95 | # error Do not know how to define a 32-bit integer quantity on your system 96 | #endif 97 | 98 | } // namespace GFLAGS_NAMESPACE 99 | 100 | 101 | namespace fLS { 102 | 103 | // The meaning of "string" might be different between now and when the 104 | // macros below get invoked (e.g., if someone is experimenting with 105 | // other string implementations that get defined after this file is 106 | // included). Save the current meaning now and use it in the macros. 107 | typedef std::string clstring; 108 | 109 | } // namespace fLS 110 | 111 | 112 | #define DECLARE_VARIABLE(type, shorttype, name) \ 113 | /* We always want to import declared variables, dll or no */ \ 114 | namespace fL##shorttype { extern GFLAGS_DLL_DECLARE_FLAG type FLAGS_##name; } \ 115 | using fL##shorttype::FLAGS_##name 116 | 117 | #define DECLARE_bool(name) \ 118 | DECLARE_VARIABLE(bool, B, name) 119 | 120 | #define DECLARE_int32(name) \ 121 | DECLARE_VARIABLE(::GFLAGS_NAMESPACE::int32, I, name) 122 | 123 | #define DECLARE_int64(name) \ 124 | DECLARE_VARIABLE(::GFLAGS_NAMESPACE::int64, I64, name) 125 | 126 | #define DECLARE_uint64(name) \ 127 | DECLARE_VARIABLE(::GFLAGS_NAMESPACE::uint64, U64, name) 128 | 129 | #define DECLARE_double(name) \ 130 | DECLARE_VARIABLE(double, D, name) 131 | 132 | #define DECLARE_string(name) \ 133 | /* We always want to import declared variables, dll or no */ \ 134 | namespace fLS { \ 135 | using ::fLS::clstring; \ 136 | extern GFLAGS_DLL_DECLARE_FLAG ::fLS::clstring& FLAGS_##name; \ 137 | } \ 138 | using fLS::FLAGS_##name 139 | 140 | 141 | #endif // GFLAGS_DECLARE_H_ 142 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/compiled/gflags/include/gflags/gflags_gflags.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Andreas Schuh 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // ----------------------------------------------------------------------------- 31 | // Imports the gflags library symbols into an alternative/deprecated namespace. 32 | 33 | #ifndef GFLAGS_GFLAGS_H_ 34 | # error The internal header gflags_gflags.h may only be included by gflags.h 35 | #endif 36 | 37 | #ifndef GFLAGS_NS_GFLAGS_H_ 38 | #define GFLAGS_NS_GFLAGS_H_ 39 | 40 | 41 | namespace gflags { 42 | 43 | 44 | using GFLAGS_NAMESPACE::int32; 45 | using GFLAGS_NAMESPACE::uint32; 46 | using GFLAGS_NAMESPACE::int64; 47 | using GFLAGS_NAMESPACE::uint64; 48 | 49 | using GFLAGS_NAMESPACE::RegisterFlagValidator; 50 | using GFLAGS_NAMESPACE::CommandLineFlagInfo; 51 | using GFLAGS_NAMESPACE::GetAllFlags; 52 | using GFLAGS_NAMESPACE::ShowUsageWithFlags; 53 | using GFLAGS_NAMESPACE::ShowUsageWithFlagsRestrict; 54 | using GFLAGS_NAMESPACE::DescribeOneFlag; 55 | using GFLAGS_NAMESPACE::SetArgv; 56 | using GFLAGS_NAMESPACE::GetArgvs; 57 | using GFLAGS_NAMESPACE::GetArgv; 58 | using GFLAGS_NAMESPACE::GetArgv0; 59 | using GFLAGS_NAMESPACE::GetArgvSum; 60 | using GFLAGS_NAMESPACE::ProgramInvocationName; 61 | using GFLAGS_NAMESPACE::ProgramInvocationShortName; 62 | using GFLAGS_NAMESPACE::ProgramUsage; 63 | using GFLAGS_NAMESPACE::VersionString; 64 | using GFLAGS_NAMESPACE::GetCommandLineOption; 65 | using GFLAGS_NAMESPACE::GetCommandLineFlagInfo; 66 | using GFLAGS_NAMESPACE::GetCommandLineFlagInfoOrDie; 67 | using GFLAGS_NAMESPACE::FlagSettingMode; 68 | using GFLAGS_NAMESPACE::SET_FLAGS_VALUE; 69 | using GFLAGS_NAMESPACE::SET_FLAG_IF_DEFAULT; 70 | using GFLAGS_NAMESPACE::SET_FLAGS_DEFAULT; 71 | using GFLAGS_NAMESPACE::SetCommandLineOption; 72 | using GFLAGS_NAMESPACE::SetCommandLineOptionWithMode; 73 | using GFLAGS_NAMESPACE::FlagSaver; 74 | using GFLAGS_NAMESPACE::CommandlineFlagsIntoString; 75 | using GFLAGS_NAMESPACE::ReadFlagsFromString; 76 | using GFLAGS_NAMESPACE::AppendFlagsIntoFile; 77 | using GFLAGS_NAMESPACE::ReadFromFlagsFile; 78 | using GFLAGS_NAMESPACE::BoolFromEnv; 79 | using GFLAGS_NAMESPACE::Int32FromEnv; 80 | using GFLAGS_NAMESPACE::Int64FromEnv; 81 | using GFLAGS_NAMESPACE::Uint64FromEnv; 82 | using GFLAGS_NAMESPACE::DoubleFromEnv; 83 | using GFLAGS_NAMESPACE::StringFromEnv; 84 | using GFLAGS_NAMESPACE::SetUsageMessage; 85 | using GFLAGS_NAMESPACE::SetVersionString; 86 | using GFLAGS_NAMESPACE::ParseCommandLineNonHelpFlags; 87 | using GFLAGS_NAMESPACE::HandleCommandLineHelpFlags; 88 | using GFLAGS_NAMESPACE::AllowCommandLineReparsing; 89 | using GFLAGS_NAMESPACE::ReparseCommandLineNonHelpFlags; 90 | using GFLAGS_NAMESPACE::ShutDownCommandLineFlags; 91 | using GFLAGS_NAMESPACE::FlagRegisterer; 92 | 93 | #ifndef SWIG 94 | using GFLAGS_NAMESPACE::ParseCommandLineFlags; 95 | #endif 96 | 97 | 98 | } // namespace gflags 99 | 100 | 101 | #endif // GFLAGS_NS_GFLAGS_H_ 102 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/.gitattributes: -------------------------------------------------------------------------------- 1 | # treat all files in this repository as text files 2 | # and normalize them to LF line endings when committed 3 | * text 4 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/.gitignore: -------------------------------------------------------------------------------- 1 | /xcode/ 2 | /build/ 3 | /build-*/ 4 | .DS_Store 5 | CMakeCache.txt 6 | DartConfiguration.tcl 7 | Makefile 8 | CMakeFiles/ 9 | /Testing/ 10 | /include/gflags/config.h 11 | /include/gflags/gflags_completions.h 12 | /include/gflags/gflags_declare.h 13 | /include/gflags/gflags.h 14 | /lib/ 15 | /test/gflags_unittest_main.cc 16 | /test/gflags_unittest-main.cc 17 | /packages/ 18 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "doc"] 2 | path = doc 3 | url = https://github.com/gflags/gflags.git 4 | branch = gh-pages 5 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | google-gflags@googlegroups.com 2 | 3 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/INSTALL.md: -------------------------------------------------------------------------------- 1 | Installing a binary distribution package 2 | ======================================== 3 | 4 | No official binary distribution packages are provided by the gflags developers. 5 | There may, however, be binary packages available for your OS. Please consult 6 | also the package repositories of your Linux distribution. 7 | 8 | For example on Debian/Ubuntu Linux, gflags can be installed using the 9 | following command: 10 | 11 | sudo apt-get install gflags 12 | 13 | 14 | Compiling the source code 15 | ========================= 16 | 17 | The build system of gflags is since version 2.1 based on [CMake](http://cmake.org). 18 | The common steps to build, test, and install software are therefore: 19 | 20 | 1. Extract source files. 21 | 2. Create build directory and change to it. 22 | 3. Run CMake to configure the build tree. 23 | 4. Build the software using selected build tool. 24 | 5. Test the built software. 25 | 6. Install the built files. 26 | 27 | On Unix-like systems with GNU Make as build tool, these build steps can be 28 | summarized by the following sequence of commands executed in a shell, 29 | where ```$package``` and ```$version``` are shell variables which represent 30 | the name of this package and the obtained version of the software. 31 | 32 | $ tar xzf gflags-$version-source.tar.gz 33 | $ cd gflags-$version 34 | $ mkdir build && cd build 35 | $ ccmake .. 36 | 37 | - Press 'c' to configure the build system and 'e' to ignore warnings. 38 | - Set CMAKE_INSTALL_PREFIX and other CMake variables and options. 39 | - Continue pressing 'c' until the option 'g' is available. 40 | - Then press 'g' to generate the configuration files for GNU Make. 41 | 42 | $ make 43 | $ make test (optional) 44 | $ make install (optional) 45 | 46 | In the following, only gflags-specific CMake settings available to 47 | configure the build and installation are documented. Note that most of these 48 | variables are for advanced users and binary package maintainers only. 49 | They usually do not have to be modified. 50 | 51 | 52 | CMake Option | Description 53 | --------------------------- | ------------------------------------------------------- 54 | CMAKE_INSTALL_PREFIX | Installation directory, e.g., "/usr/local" on Unix and "C:\Program Files\gflags" on Windows. 55 | BUILD_SHARED_LIBS | Request build of dynamic link libraries. 56 | BUILD_STATIC_LIBS | Request build of static link libraries. Implied if BUILD_SHARED_LIBS is OFF. 57 | BUILD_PACKAGING | Enable binary package generation using CPack. 58 | BUILD_TESTING | Build tests for execution by CTest. 59 | BUILD_NC_TESTS | Request inclusion of negative compilation tests (requires Python). 60 | BUILD_CONFIG_TESTS | Request inclusion of package configuration tests (requires Python). 61 | BUILD_gflags_LIBS | Request build of multi-threaded gflags libraries (if threading library found). 62 | BUILD_gflags_nothreads_LIBS | Request build of single-threaded gflags libraries. 63 | GFLAGS_NAMESPACE | Name of the C++ namespace to be used by the gflags library. Note that the public source header files are installed in a subdirectory named after this namespace. To maintain backwards compatibility with the Google Commandline Flags, set this variable to "google". The default is "gflags". 64 | GFLAGS_INTTYPES_FORMAT | String identifying format of built-in integer types. 65 | GFLAGS_INCLUDE_DIR | Name of headers installation directory relative to CMAKE_INSTALL_PREFIX. 66 | LIBRARY_INSTALL_DIR | Name of library installation directory relative to CMAKE_INSTALL_PREFIX. 67 | INSTALL_HEADERS | Request installation of public header files. 68 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/cmake/README_runtime.txt: -------------------------------------------------------------------------------- 1 | This package contains runtime libraries only which are required 2 | by applications that use these libraries for the commandline flags 3 | processing. If you want to develop such application, download 4 | and install the development package instead. 5 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | ## gflags CMake configuration file 2 | 3 | # library version information 4 | set (@PACKAGE_NAME@_VERSION_STRING "@PACKAGE_VERSION@") 5 | set (@PACKAGE_NAME@_VERSION_MAJOR @PACKAGE_VERSION_MAJOR@) 6 | set (@PACKAGE_NAME@_VERSION_MINOR @PACKAGE_VERSION_MINOR@) 7 | set (@PACKAGE_NAME@_VERSION_PATCH @PACKAGE_VERSION_PATCH@) 8 | 9 | # import targets 10 | include ("${CMAKE_CURRENT_LIST_DIR}/@PACKAGE_NAME@-export.cmake") 11 | 12 | # installation prefix 13 | get_filename_component (CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 14 | get_filename_component (_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PREFIX_REL2CONFIG_DIR@" ABSOLUTE) 15 | 16 | # include directory 17 | # 18 | # Newer versions of CMake set the INTERFACE_INCLUDE_DIRECTORIES property 19 | # of the imported targets. It is hence not necessary to add this path 20 | # manually to the include search path for targets which link to gflags. 21 | set (@PACKAGE_NAME@_INCLUDE_DIR "${_INSTALL_PREFIX}/@INCLUDE_INSTALL_DIR@") 22 | 23 | # default settings 24 | if (NOT DEFINED @PACKAGE_NAME@_SHARED) 25 | if (TARGET @PACKAGE_NAME@-static OR TARGET @PACKAGE_NAME@_nothreads-static) 26 | set (@PACKAGE_NAME@_SHARED FALSE) 27 | else () 28 | set (@PACKAGE_NAME@_SHARED TRUE) 29 | endif () 30 | endif () 31 | if (NOT DEFINED @PACKAGE_NAME@_NOTHREADS) 32 | if (TARGET @PACKAGE_NAME@-static OR TARGET @PACKAGE_NAME@-shared) 33 | set (@PACKAGE_NAME@_NOTHREADS FALSE) 34 | else () 35 | set (@PACKAGE_NAME@_NOTHREADS TRUE) 36 | endif () 37 | endif () 38 | 39 | # choose imported library target 40 | if (NOT @PACKAGE_NAME@_TARGET) 41 | if (@PACKAGE_NAME@_SHARED) 42 | if (@PACKAGE_NAME@_NOTHREADS) 43 | set (@PACKAGE_NAME@_TARGET @PACKAGE_NAME@_nothreads-shared) 44 | else () 45 | set (@PACKAGE_NAME@_TARGET @PACKAGE_NAME@-shared) 46 | endif () 47 | else () 48 | if (@PACKAGE_NAME@_NOTHREADS) 49 | set (@PACKAGE_NAME@_TARGET @PACKAGE_NAME@_nothreads-static) 50 | else () 51 | set (@PACKAGE_NAME@_TARGET @PACKAGE_NAME@-static) 52 | endif () 53 | endif () 54 | endif () 55 | if (NOT TARGET ${@PACKAGE_NAME@_TARGET}) 56 | message (FATAL_ERROR "Your @PACKAGE_NAME@ installation does not contain a ${@PACKAGE_NAME@_TARGET} library target!" 57 | " Try a different combination of @PACKAGE_NAME@_SHARED and @PACKAGE_NAME@_NOTHREADS.") 58 | endif () 59 | 60 | # add more convenient "@PACKAGE_NAME@" import target 61 | if (NOT TARGET @PACKAGE_NAME@) 62 | if (@PACKAGE_NAME@_SHARED) 63 | add_library (@PACKAGE_NAME@ SHARED IMPORTED) 64 | else () 65 | add_library (@PACKAGE_NAME@ STATIC IMPORTED) 66 | endif () 67 | # INTERFACE_INCLUDE_DIRECTORIES 68 | get_target_property (_@PACKAGE_NAME@_INCLUDES ${@PACKAGE_NAME@_TARGET} INTERFACE_INCLUDE_DIRECTORIES) 69 | if (_@PACKAGE_NAME@_INCLUDES) 70 | set_target_properties(@PACKAGE_NAME@ PROPERTIES 71 | INTERFACE_INCLUDE_DIRECTORIES "${_@PACKAGE_NAME@_INCLUDES}" 72 | ) 73 | endif () 74 | unset (_@PACKAGE_NAME@_INCLUDES) 75 | # set configuration specific properties 76 | get_target_property (_@PACKAGE_NAME@_CONFIGURATIONS ${@PACKAGE_NAME@_TARGET} IMPORTED_CONFIGURATIONS) 77 | set_target_properties (@PACKAGE_NAME@ PROPERTIES IMPORTED_CONFIGURATIONS "${_@PACKAGE_NAME@_CONFIGURATIONS}") 78 | foreach (_@PACKAGE_NAME@_CONFIG IN LISTS _@PACKAGE_NAME@_CONFIGURATIONS) 79 | # IMPORTED_LOCATION_ 80 | get_target_property (_@PACKAGE_NAME@_LOCATION ${@PACKAGE_NAME@_TARGET} IMPORTED_LOCATION_${_@PACKAGE_NAME@_CONFIG}) 81 | if (_@PACKAGE_NAME@_LOCATION) 82 | set_target_properties(@PACKAGE_NAME@ PROPERTIES 83 | IMPORTED_LOCATION_${_@PACKAGE_NAME@_CONFIG} "${_@PACKAGE_NAME@_LOCATION}" 84 | ) 85 | endif () 86 | unset (_@PACKAGE_NAME@_LOCATION) 87 | # IMPORTED_LINK_INTERFACE_LANGUAGES_ (static) 88 | get_target_property (_@PACKAGE_NAME@_LANGUAGES ${@PACKAGE_NAME@_TARGET} IMPORTED_LINK_INTERFACE_LANGUAGES_${_@PACKAGE_NAME@_CONFIG}) 89 | if (_@PACKAGE_NAME@_LANGUAGES) 90 | set_target_properties(@PACKAGE_NAME@ PROPERTIES 91 | IMPORTED_LINK_INTERFACE_LANGUAGES_${_@PACKAGE_NAME@_CONFIG} "${_@PACKAGE_NAME@_LANGUAGES}" 92 | ) 93 | endif () 94 | unset (_@PACKAGE_NAME@_LANGUAGES) 95 | # IMPORTED_SONAME_ (shared) 96 | get_target_property (_@PACKAGE_NAME@_SONAME ${@PACKAGE_NAME@_TARGET} IMPORTED_SONAME_${_@PACKAGE_NAME@_CONFIG}) 97 | if (_@PACKAGE_NAME@_SONAME) 98 | set_target_properties(@PACKAGE_NAME@ PROPERTIES 99 | IMPORTED_SONAME_${_@PACKAGE_NAME@_CONFIG} "${_@PACKAGE_NAME@_SONAME}" 100 | ) 101 | endif () 102 | unset (_@PACKAGE_NAME@_SONAME) 103 | endforeach () 104 | unset (_@PACKAGE_NAME@_CONFIGURATIONS) 105 | endif () 106 | 107 | # alias for default import target to be compatible with older CMake package configurations 108 | set (@PACKAGE_NAME@_LIBRARIES "${@PACKAGE_NAME@_TARGET}") 109 | 110 | # unset private variables 111 | unset (_INSTALL_PREFIX) 112 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/cmake/execute_test.cmake: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------------- 2 | # sanitize string stored in variable for use in regular expression. 3 | macro (sanitize_for_regex STRVAR) 4 | string (REGEX REPLACE "([.+*?^$()])" "\\\\\\1" ${STRVAR} "${${STRVAR}}") 5 | endmacro () 6 | 7 | # ---------------------------------------------------------------------------- 8 | # script arguments 9 | if (NOT COMMAND) 10 | message (FATAL_ERROR "Test command not specified!") 11 | endif () 12 | if (NOT DEFINED EXPECTED_RC) 13 | set (EXPECTED_RC 0) 14 | endif () 15 | if (EXPECTED_OUTPUT) 16 | sanitize_for_regex(EXPECTED_OUTPUT) 17 | endif () 18 | if (UNEXPECTED_OUTPUT) 19 | sanitize_for_regex(UNEXPECTED_OUTPUT) 20 | endif () 21 | 22 | # ---------------------------------------------------------------------------- 23 | # set a few environment variables (useful for --tryfromenv) 24 | set (ENV{FLAGS_undefok} "foo,bar") 25 | set (ENV{FLAGS_weirdo} "") 26 | set (ENV{FLAGS_version} "true") 27 | set (ENV{FLAGS_help} "false") 28 | 29 | # ---------------------------------------------------------------------------- 30 | # execute test command 31 | execute_process( 32 | COMMAND ${COMMAND} 33 | RESULT_VARIABLE RC 34 | OUTPUT_VARIABLE OUTPUT 35 | ERROR_VARIABLE OUTPUT 36 | ) 37 | 38 | if (OUTPUT) 39 | message ("${OUTPUT}") 40 | endif () 41 | 42 | # ---------------------------------------------------------------------------- 43 | # check test result 44 | if (NOT RC EQUAL EXPECTED_RC) 45 | string (REPLACE ";" " " COMMAND "${COMMAND}") 46 | message (FATAL_ERROR "Command:\n\t${COMMAND}\nExit status is ${RC}, expected ${EXPECTED_RC}") 47 | endif () 48 | if (EXPECTED_OUTPUT AND NOT OUTPUT MATCHES "${EXPECTED_OUTPUT}") 49 | message (FATAL_ERROR "Test output does not match expected output: ${EXPECTED_OUTPUT}") 50 | endif () 51 | if (UNEXPECTED_OUTPUT AND OUTPUT MATCHES "${UNEXPECTED_OUTPUT}") 52 | message (FATAL_ERROR "Test output matches unexpected output: ${UNEXPECTED_OUTPUT}") 53 | endif () -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/cmake/package.cmake.in: -------------------------------------------------------------------------------- 1 | # Per-generator CPack configuration file. See CPACK_PROJECT_CONFIG_FILE documented at 2 | # http://www.cmake.org/cmake/help/v2.8.12/cpack.html#variable:CPACK_PROJECT_CONFIG_FILE 3 | # 4 | # All common CPACK_* variables are set in CMakeLists.txt already. This file only 5 | # overrides some of these to provide package generator specific settings. 6 | 7 | # whether package contains all development files or only runtime files 8 | set (DEVEL @INSTALL_HEADERS@) 9 | 10 | # ------------------------------------------------------------------------------ 11 | # Mac OS X package 12 | if (CPACK_GENERATOR MATCHES "PackageMaker|DragNDrop") 13 | 14 | set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}") 15 | if (DEVEL) 16 | set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-devel") 17 | endif () 18 | set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CPACK_PACKAGE_VERSION}") 19 | 20 | # ------------------------------------------------------------------------------ 21 | # Debian package 22 | elseif (CPACK_GENERATOR MATCHES "DEB") 23 | 24 | set (CPACK_PACKAGE_FILE_NAME "lib${CPACK_PACKAGE_NAME}") 25 | if (DEVEL) 26 | set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-dev") 27 | else () 28 | set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}0") 29 | endif () 30 | set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_${CPACK_PACKAGE_VERSION}-1_${CPACK_PACKAGE_ARCHITECTURE}") 31 | 32 | set (CPACK_DEBIAN_PACKAGE_DEPENDS) 33 | set (CPACK_DEBIAN_PACKAGE_SECTION "devel") 34 | set (CPACK_DEBIAN_PACKAGE_PRIORITY "optional") 35 | set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_RPM_PACKAGE_URL}") 36 | set (CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR}") 37 | set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CPACK_PACKAGE_ARCHITECTURE}") 38 | 39 | # ------------------------------------------------------------------------------ 40 | # RPM package 41 | elseif (CPACK_GENERATOR MATCHES "RPM") 42 | 43 | set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}") 44 | if (DEVEL) 45 | set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-devel") 46 | endif () 47 | set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CPACK_PACKAGE_VERSION}-1.${CPACK_PACKAGE_ARCHITECTURE}") 48 | 49 | endif () 50 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/cmake/utils.cmake: -------------------------------------------------------------------------------- 1 | ## Utility CMake functions. 2 | 3 | # ---------------------------------------------------------------------------- 4 | ## Convert boolean value to 0 or 1 5 | macro (bool_to_int VAR) 6 | if (${VAR}) 7 | set (${VAR} 1) 8 | else () 9 | set (${VAR} 0) 10 | endif () 11 | endmacro () 12 | 13 | # ---------------------------------------------------------------------------- 14 | ## Extract version numbers from version string. 15 | function (version_numbers version major minor patch) 16 | if (version MATCHES "([0-9]+)(\\.[0-9]+)?(\\.[0-9]+)?(rc[1-9][0-9]*|[a-z]+)?") 17 | if (CMAKE_MATCH_1) 18 | set (_major ${CMAKE_MATCH_1}) 19 | else () 20 | set (_major 0) 21 | endif () 22 | if (CMAKE_MATCH_2) 23 | set (_minor ${CMAKE_MATCH_2}) 24 | string (REGEX REPLACE "^\\." "" _minor "${_minor}") 25 | else () 26 | set (_minor 0) 27 | endif () 28 | if (CMAKE_MATCH_3) 29 | set (_patch ${CMAKE_MATCH_3}) 30 | string (REGEX REPLACE "^\\." "" _patch "${_patch}") 31 | else () 32 | set (_patch 0) 33 | endif () 34 | else () 35 | set (_major 0) 36 | set (_minor 0) 37 | set (_patch 0) 38 | endif () 39 | set ("${major}" "${_major}" PARENT_SCOPE) 40 | set ("${minor}" "${_minor}" PARENT_SCOPE) 41 | set ("${patch}" "${_patch}" PARENT_SCOPE) 42 | endfunction () 43 | 44 | # ---------------------------------------------------------------------------- 45 | ## Configure public header files 46 | function (configure_headers out) 47 | set (tmp) 48 | foreach (src IN LISTS ARGN) 49 | if (IS_ABSOLUTE "${src}") 50 | list (APPEND tmp "${src}") 51 | elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/${src}.in") 52 | configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}" @ONLY) 53 | list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}") 54 | else () 55 | configure_file ("${PROJECT_SOURCE_DIR}/src/${src}" "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}" COPYONLY) 56 | list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}") 57 | endif () 58 | endforeach () 59 | set (${out} "${tmp}" PARENT_SCOPE) 60 | endfunction () 61 | 62 | # ---------------------------------------------------------------------------- 63 | ## Configure source files with .in suffix 64 | function (configure_sources out) 65 | set (tmp) 66 | foreach (src IN LISTS ARGN) 67 | if (src MATCHES ".h$" AND EXISTS "${PROJECT_SOURCE_DIR}/src/${src}.in") 68 | configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}" @ONLY) 69 | list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}") 70 | else () 71 | list (APPEND tmp "${PROJECT_SOURCE_DIR}/src/${src}") 72 | endif () 73 | endforeach () 74 | set (${out} "${tmp}" PARENT_SCOPE) 75 | endfunction () 76 | 77 | # ---------------------------------------------------------------------------- 78 | ## Add usage test 79 | # 80 | # Using PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION would 81 | # do as well, but CMake/CTest does not allow us to specify an 82 | # expected exit status. Moreover, the execute_test.cmake script 83 | # sets environment variables needed by the --fromenv/--tryfromenv tests. 84 | macro (add_gflags_test name expected_rc expected_output unexpected_output cmd) 85 | set (args "--test_tmpdir=${PROJECT_BINARY_DIR}/Testing/Temporary" 86 | "--srcdir=${PROJECT_SOURCE_DIR}/test") 87 | add_test ( 88 | NAME ${name} 89 | COMMAND "${CMAKE_COMMAND}" "-DCOMMAND:STRING=$;${args};${ARGN}" 90 | "-DEXPECTED_RC:STRING=${expected_rc}" 91 | "-DEXPECTED_OUTPUT:STRING=${expected_output}" 92 | "-DUNEXPECTED_OUTPUT:STRING=${unexpected_output}" 93 | -P "${PROJECT_SOURCE_DIR}/cmake/execute_test.cmake" 94 | WORKING_DIRECTORY "${GFLAGS_FLAGFILES_DIR}" 95 | ) 96 | endmacro () 97 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/cmake/version.cmake.in: -------------------------------------------------------------------------------- 1 | ## gflags CMake configuration version file 2 | 3 | # ----------------------------------------------------------------------------- 4 | # library version 5 | set (PACKAGE_VERSION "@PACKAGE_VERSION@") 6 | 7 | # ----------------------------------------------------------------------------- 8 | # check compatibility 9 | 10 | # Perform compatibility check here using the input CMake variables. 11 | # See example in http://www.cmake.org/Wiki/CMake_2.6_Notes. 12 | 13 | set (PACKAGE_VERSION_COMPATIBLE TRUE) 14 | set (PACKAGE_VERSION_UNSUITABLE FALSE) 15 | 16 | if ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "@PACKAGE_VERSION_MAJOR@" AND 17 | "${PACKAGE_FIND_VERSION_MINOR}" EQUAL "@PACKAGE_VERSION_MINOR@") 18 | set (PACKAGE_VERSION_EXACT TRUE) 19 | else () 20 | set (PACKAGE_VERSION_EXACT FALSE) 21 | endif () 22 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/src/config.h.in: -------------------------------------------------------------------------------- 1 | /* Generated from config.h.in during build configuration using CMake. */ 2 | 3 | // Note: This header file is only used internally. It is not part of public interface! 4 | 5 | // --------------------------------------------------------------------------- 6 | // System checks 7 | 8 | // Define if you build this library for a MS Windows OS. 9 | #cmakedefine OS_WINDOWS 10 | 11 | // Define if you have the header file. 12 | #cmakedefine HAVE_STDINT_H 13 | 14 | // Define if you have the header file. 15 | #cmakedefine HAVE_SYS_TYPES_H 16 | 17 | // Define if you have the header file. 18 | #cmakedefine HAVE_INTTYPES_H 19 | 20 | // Define if you have the header file. 21 | #cmakedefine HAVE_SYS_STAT_H 22 | 23 | // Define if you have the header file. 24 | #cmakedefine HAVE_UNISTD_H 25 | 26 | // Define if you have the header file. 27 | #cmakedefine HAVE_FNMATCH_H 28 | 29 | // Define if you have the header file (Windows 2000/XP). 30 | #cmakedefine HAVE_SHLWAPI_H 31 | 32 | // Define if you have the strtoll function. 33 | #cmakedefine HAVE_STRTOLL 34 | 35 | // Define if you have the strtoq function. 36 | #cmakedefine HAVE_STRTOQ 37 | 38 | // Define if you have the header file. 39 | #cmakedefine HAVE_PTHREAD 40 | 41 | // Define if your pthread library defines the type pthread_rwlock_t 42 | #cmakedefine HAVE_RWLOCK 43 | 44 | // gcc requires this to get PRId64, etc. 45 | #if defined(HAVE_INTTYPES_H) && !defined(__STDC_FORMAT_MACROS) 46 | # define __STDC_FORMAT_MACROS 1 47 | #endif 48 | 49 | // --------------------------------------------------------------------------- 50 | // Package information 51 | 52 | // Name of package. 53 | #define PACKAGE @PROJECT_NAME@ 54 | 55 | // Define to the full name of this package. 56 | #define PACKAGE_NAME @PACKAGE_NAME@ 57 | 58 | // Define to the full name and version of this package. 59 | #define PACKAGE_STRING @PACKAGE_STRING@ 60 | 61 | // Define to the one symbol short name of this package. 62 | #define PACKAGE_TARNAME @PACKAGE_TARNAME@ 63 | 64 | // Define to the version of this package. 65 | #define PACKAGE_VERSION @PACKAGE_VERSION@ 66 | 67 | // Version number of package. 68 | #define VERSION PACKAGE_VERSION 69 | 70 | // Define to the address where bug reports for this package should be sent. 71 | #define PACKAGE_BUGREPORT @PACKAGE_BUGREPORT@ 72 | 73 | // --------------------------------------------------------------------------- 74 | // Path separator 75 | #ifndef PATH_SEPARATOR 76 | # ifdef OS_WINDOWS 77 | # define PATH_SEPARATOR '\\' 78 | # else 79 | # define PATH_SEPARATOR '/' 80 | # endif 81 | #endif 82 | 83 | // --------------------------------------------------------------------------- 84 | // Windows 85 | 86 | // Whether gflags library is a DLL. 87 | #ifndef GFLAGS_IS_A_DLL 88 | # define GFLAGS_IS_A_DLL 0 89 | #endif 90 | 91 | // Always export symbols when compiling a shared library as this file is only 92 | // included by internal modules when building the gflags library itself. 93 | // The gflags_declare.h header file will set it to import these symbols otherwise. 94 | #ifndef GFLAGS_DLL_DECL 95 | # if GFLAGS_IS_A_DLL && defined(_MSC_VER) 96 | # define GFLAGS_DLL_DECL __declspec(dllexport) 97 | # else 98 | # define GFLAGS_DLL_DECL 99 | # endif 100 | #endif 101 | // Flags defined by the gflags library itself must be exported 102 | #ifndef GFLAGS_DLL_DEFINE_FLAG 103 | # define GFLAGS_DLL_DEFINE_FLAG GFLAGS_DLL_DECL 104 | #endif 105 | 106 | #ifdef OS_WINDOWS 107 | // The unittests import the symbols of the shared gflags library 108 | # if GFLAGS_IS_A_DLL && defined(_MSC_VER) 109 | # define GFLAGS_DLL_DECL_FOR_UNITTESTS __declspec(dllimport) 110 | # endif 111 | # include "windows_port.h" 112 | #endif 113 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/src/gflags_declare.h.in: -------------------------------------------------------------------------------- 1 | // Copyright (c) 1999, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // --- 31 | // 32 | // Revamped and reorganized by Craig Silverstein 33 | // 34 | // This is the file that should be included by any file which declares 35 | // command line flag. 36 | 37 | #ifndef GFLAGS_DECLARE_H_ 38 | #define GFLAGS_DECLARE_H_ 39 | 40 | 41 | // --------------------------------------------------------------------------- 42 | // Namespace of gflags library symbols. 43 | #define GFLAGS_NAMESPACE @GFLAGS_NAMESPACE@ 44 | 45 | // --------------------------------------------------------------------------- 46 | // Windows DLL import/export. 47 | 48 | // We always want to import the symbols of the gflags library 49 | #ifndef GFLAGS_DLL_DECL 50 | # if @GFLAGS_IS_A_DLL@ && defined(_MSC_VER) 51 | # define GFLAGS_DLL_DECL __declspec(dllimport) 52 | # else 53 | # define GFLAGS_DLL_DECL 54 | # endif 55 | #endif 56 | 57 | // We always want to import variables declared in user code 58 | #ifndef GFLAGS_DLL_DECLARE_FLAG 59 | # ifdef _MSC_VER 60 | # define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport) 61 | # else 62 | # define GFLAGS_DLL_DECLARE_FLAG 63 | # endif 64 | #endif 65 | 66 | // --------------------------------------------------------------------------- 67 | // Flag types 68 | #include 69 | #if @HAVE_STDINT_H@ 70 | # include // the normal place uint32_t is defined 71 | #elif @HAVE_SYS_TYPES_H@ 72 | # include // the normal place u_int32_t is defined 73 | #elif @HAVE_INTTYPES_H@ 74 | # include // a third place for uint32_t or u_int32_t 75 | #endif 76 | 77 | namespace GFLAGS_NAMESPACE { 78 | 79 | #if @GFLAGS_INTTYPES_FORMAT_C99@ // C99 80 | typedef int32_t int32; 81 | typedef uint32_t uint32; 82 | typedef int64_t int64; 83 | typedef uint64_t uint64; 84 | #elif @GFLAGS_INTTYPES_FORMAT_BSD@ // BSD 85 | typedef int32_t int32; 86 | typedef u_int32_t uint32; 87 | typedef int64_t int64; 88 | typedef u_int64_t uint64; 89 | #elif @GFLAGS_INTTYPES_FORMAT_VC7@ // Windows 90 | typedef __int32 int32; 91 | typedef unsigned __int32 uint32; 92 | typedef __int64 int64; 93 | typedef unsigned __int64 uint64; 94 | #else 95 | # error Do not know how to define a 32-bit integer quantity on your system 96 | #endif 97 | 98 | } // namespace GFLAGS_NAMESPACE 99 | 100 | 101 | namespace fLS { 102 | 103 | // The meaning of "string" might be different between now and when the 104 | // macros below get invoked (e.g., if someone is experimenting with 105 | // other string implementations that get defined after this file is 106 | // included). Save the current meaning now and use it in the macros. 107 | typedef std::string clstring; 108 | 109 | } // namespace fLS 110 | 111 | 112 | #define DECLARE_VARIABLE(type, shorttype, name) \ 113 | /* We always want to import declared variables, dll or no */ \ 114 | namespace fL##shorttype { extern GFLAGS_DLL_DECLARE_FLAG type FLAGS_##name; } \ 115 | using fL##shorttype::FLAGS_##name 116 | 117 | #define DECLARE_bool(name) \ 118 | DECLARE_VARIABLE(bool, B, name) 119 | 120 | #define DECLARE_int32(name) \ 121 | DECLARE_VARIABLE(::GFLAGS_NAMESPACE::int32, I, name) 122 | 123 | #define DECLARE_int64(name) \ 124 | DECLARE_VARIABLE(::GFLAGS_NAMESPACE::int64, I64, name) 125 | 126 | #define DECLARE_uint64(name) \ 127 | DECLARE_VARIABLE(::GFLAGS_NAMESPACE::uint64, U64, name) 128 | 129 | #define DECLARE_double(name) \ 130 | DECLARE_VARIABLE(double, D, name) 131 | 132 | #define DECLARE_string(name) \ 133 | /* We always want to import declared variables, dll or no */ \ 134 | namespace fLS { \ 135 | using ::fLS::clstring; \ 136 | extern GFLAGS_DLL_DECLARE_FLAG ::fLS::clstring& FLAGS_##name; \ 137 | } \ 138 | using fLS::FLAGS_##name 139 | 140 | 141 | #endif // GFLAGS_DECLARE_H_ 142 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/src/gflags_ns.h.in: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Andreas Schuh 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // ----------------------------------------------------------------------------- 31 | // Imports the gflags library symbols into an alternative/deprecated namespace. 32 | 33 | #ifndef GFLAGS_GFLAGS_H_ 34 | # error The internal header gflags_@ns@.h may only be included by gflags.h 35 | #endif 36 | 37 | #ifndef GFLAGS_NS_@NS@_H_ 38 | #define GFLAGS_NS_@NS@_H_ 39 | 40 | 41 | namespace @ns@ { 42 | 43 | 44 | using GFLAGS_NAMESPACE::int32; 45 | using GFLAGS_NAMESPACE::uint32; 46 | using GFLAGS_NAMESPACE::int64; 47 | using GFLAGS_NAMESPACE::uint64; 48 | 49 | using GFLAGS_NAMESPACE::RegisterFlagValidator; 50 | using GFLAGS_NAMESPACE::CommandLineFlagInfo; 51 | using GFLAGS_NAMESPACE::GetAllFlags; 52 | using GFLAGS_NAMESPACE::ShowUsageWithFlags; 53 | using GFLAGS_NAMESPACE::ShowUsageWithFlagsRestrict; 54 | using GFLAGS_NAMESPACE::DescribeOneFlag; 55 | using GFLAGS_NAMESPACE::SetArgv; 56 | using GFLAGS_NAMESPACE::GetArgvs; 57 | using GFLAGS_NAMESPACE::GetArgv; 58 | using GFLAGS_NAMESPACE::GetArgv0; 59 | using GFLAGS_NAMESPACE::GetArgvSum; 60 | using GFLAGS_NAMESPACE::ProgramInvocationName; 61 | using GFLAGS_NAMESPACE::ProgramInvocationShortName; 62 | using GFLAGS_NAMESPACE::ProgramUsage; 63 | using GFLAGS_NAMESPACE::VersionString; 64 | using GFLAGS_NAMESPACE::GetCommandLineOption; 65 | using GFLAGS_NAMESPACE::GetCommandLineFlagInfo; 66 | using GFLAGS_NAMESPACE::GetCommandLineFlagInfoOrDie; 67 | using GFLAGS_NAMESPACE::FlagSettingMode; 68 | using GFLAGS_NAMESPACE::SET_FLAGS_VALUE; 69 | using GFLAGS_NAMESPACE::SET_FLAG_IF_DEFAULT; 70 | using GFLAGS_NAMESPACE::SET_FLAGS_DEFAULT; 71 | using GFLAGS_NAMESPACE::SetCommandLineOption; 72 | using GFLAGS_NAMESPACE::SetCommandLineOptionWithMode; 73 | using GFLAGS_NAMESPACE::FlagSaver; 74 | using GFLAGS_NAMESPACE::CommandlineFlagsIntoString; 75 | using GFLAGS_NAMESPACE::ReadFlagsFromString; 76 | using GFLAGS_NAMESPACE::AppendFlagsIntoFile; 77 | using GFLAGS_NAMESPACE::ReadFromFlagsFile; 78 | using GFLAGS_NAMESPACE::BoolFromEnv; 79 | using GFLAGS_NAMESPACE::Int32FromEnv; 80 | using GFLAGS_NAMESPACE::Int64FromEnv; 81 | using GFLAGS_NAMESPACE::Uint64FromEnv; 82 | using GFLAGS_NAMESPACE::DoubleFromEnv; 83 | using GFLAGS_NAMESPACE::StringFromEnv; 84 | using GFLAGS_NAMESPACE::SetUsageMessage; 85 | using GFLAGS_NAMESPACE::SetVersionString; 86 | using GFLAGS_NAMESPACE::ParseCommandLineNonHelpFlags; 87 | using GFLAGS_NAMESPACE::HandleCommandLineHelpFlags; 88 | using GFLAGS_NAMESPACE::AllowCommandLineReparsing; 89 | using GFLAGS_NAMESPACE::ReparseCommandLineNonHelpFlags; 90 | using GFLAGS_NAMESPACE::ShutDownCommandLineFlags; 91 | using GFLAGS_NAMESPACE::FlagRegisterer; 92 | 93 | #ifndef SWIG 94 | using GFLAGS_NAMESPACE::ParseCommandLineFlags; 95 | #endif 96 | 97 | 98 | } // namespace @ns@ 99 | 100 | 101 | #endif // GFLAGS_NS_@NS@_H_ 102 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/src/windows_port.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009, Google Inc. 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above 11 | * copyright notice, this list of conditions and the following disclaimer 12 | * in the documentation and/or other materials provided with the 13 | * distribution. 14 | * * Neither the name of Google Inc. nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * --- 31 | * Author: Craig Silverstein 32 | */ 33 | 34 | #ifndef _WIN32 35 | # error You should only be including windows/port.cc in a windows environment! 36 | #endif 37 | 38 | #include // for strlen(), memset(), memcmp() 39 | #include 40 | #include // for va_list, va_start, va_end 41 | #include 42 | 43 | #include "windows_port.h" 44 | 45 | // These call the windows _vsnprintf, but always NUL-terminate. 46 | #if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */ 47 | 48 | #ifdef _MSC_VER 49 | # pragma warning(push) 50 | # pragma warning(disable: 4996) // ignore _vsnprintf security warning 51 | #endif 52 | int safe_vsnprintf(char *str, size_t size, const char *format, va_list ap) { 53 | if (size == 0) // not even room for a \0? 54 | return -1; // not what C99 says to do, but what windows does 55 | str[size-1] = '\0'; 56 | return _vsnprintf(str, size-1, format, ap); 57 | } 58 | #ifdef _MSC_VER 59 | # pragma warning(pop) 60 | #endif 61 | 62 | #if _MSC_VER < 1900 // msvs 2015 finally includes snprintf 63 | 64 | int snprintf(char *str, size_t size, const char *format, ...) { 65 | int r; 66 | va_list ap; 67 | va_start(ap, format); 68 | r = vsnprintf(str, size, format, ap); 69 | va_end(ap); 70 | return r; 71 | } 72 | 73 | #endif 74 | 75 | #endif /* #if !defined(__MINGW32__) && !defined(__MINGW64__) */ 76 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## gflags package configuration tests 2 | 3 | cmake_minimum_required (VERSION 2.8) 4 | 5 | project (gflags_${TEST_NAME}) 6 | 7 | find_package (gflags REQUIRED) 8 | 9 | add_executable (foo main.cc) 10 | target_link_libraries (foo gflags) 11 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/config/main.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | DEFINE_string(message, "Hello World!", "The message to print"); 5 | 6 | int main(int argc, char **argv) 7 | { 8 | gflags::SetUsageMessage("Test CMake configuration of gflags library (gflags-config.cmake)"); 9 | gflags::ParseCommandLineFlags(&argc, &argv, true); 10 | std::cout << FLAGS_message << std::endl; 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/config_for_unittests.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // --- 31 | // All Rights Reserved. 32 | // 33 | // 34 | // This file is needed for windows -- unittests are not part of the 35 | // gflags dll, but still want to include config.h just like the 36 | // dll does, so they can use internal tools and APIs for testing. 37 | // 38 | // The problem is that config.h declares GFLAGS_DLL_DECL to be 39 | // for exporting symbols, but the unittest needs to *import* symbols 40 | // (since it's not the dll). 41 | // 42 | // The solution is to have this file, which is just like config.h but 43 | // sets GFLAGS_DLL_DECL to do a dllimport instead of a dllexport. 44 | // 45 | // The reason we need this extra GFLAGS_DLL_DECL_FOR_UNITTESTS 46 | // variable is in case people want to set GFLAGS_DLL_DECL explicitly 47 | // to something other than __declspec(dllexport). In that case, they 48 | // may want to use something other than __declspec(dllimport) for the 49 | // unittest case. For that, we allow folks to define both 50 | // GFLAGS_DLL_DECL and GFLAGS_DLL_DECL_FOR_UNITTESTS explicitly. 51 | // 52 | // NOTE: This file is equivalent to config.h on non-windows systems, 53 | // which never defined GFLAGS_DLL_DECL_FOR_UNITTESTS and always 54 | // define GFLAGS_DLL_DECL to the empty string. 55 | 56 | #include "config.h" 57 | 58 | #ifdef GFLAGS_DLL_DECL 59 | # undef GFLAGS_DLL_DECL 60 | #endif 61 | #ifdef GFLAGS_DLL_DEFINE_FLAG 62 | # undef GFLAGS_DLL_DEFINE_FLAG 63 | #endif 64 | #ifdef GFLAGS_DLL_DECLARE_FLAG 65 | # undef GFLAGS_DLL_DECLARE_FLAG 66 | #endif 67 | 68 | #ifdef GFLAGS_DLL_DECL_FOR_UNITTESTS 69 | # define GFLAGS_DLL_DECL GFLAGS_DLL_DECL_FOR_UNITTESTS 70 | #else 71 | # define GFLAGS_DLL_DECL // if DLL_DECL_FOR_UNITTESTS isn't defined, use "" 72 | #endif 73 | 74 | // Import flags defined by gflags.cc 75 | #if GFLAGS_IS_A_DLL && defined(_MSC_VER) 76 | # define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport) 77 | #else 78 | # define GFLAGS_DLL_DECLARE_FLAG 79 | #endif -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/flagfile.1: -------------------------------------------------------------------------------- 1 | --version -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/flagfile.2: -------------------------------------------------------------------------------- 1 | --foo=bar 2 | --nounused_bool -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/flagfile.3: -------------------------------------------------------------------------------- 1 | --flagfile=flagfile.2 -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/gflags_build.py.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | import subprocess 6 | import shutil 7 | 8 | CMAKE = '@CMAKE_COMMAND@' 9 | CMAKE_BUILD_TYPE = '@CMAKE_BUILD_TYPE@' 10 | TMPDIR = '@TMPDIR@' 11 | SRCDIR = '@SRCDIR@' 12 | GFLAGS_DIR = '@gflags_BINARY_DIR@' 13 | 14 | if __name__ == "__main__": 15 | if len(sys.argv) != 4: 16 | sys.stderr.write(' '.join(['usage:', sys.argv[0], ' \n'])) 17 | sys.exit(1) 18 | test_name = sys.argv[1] 19 | srcdir = sys.argv[2] 20 | expect_fail = (sys.argv[3].lower() in ['true', 'yes', 'on', '1']) 21 | bindir = os.path.join(TMPDIR, test_name) 22 | if TMPDIR == '': 23 | sys.stderr.write('Temporary directory not set!\n') 24 | sys.exit(1) 25 | # create build directory 26 | if os.path.isdir(bindir): shutil.rmtree(bindir) 27 | os.makedirs(bindir) 28 | # configure the build tree 29 | if subprocess.call([CMAKE, '-DCMAKE_BUILD_TYPE:STRING='+CMAKE_BUILD_TYPE, 30 | '-Dgflags_DIR:PATH='+GFLAGS_DIR, 31 | '-DTEST_NAME:STRING='+test_name, srcdir], cwd=bindir) != 0: 32 | sys.stderr.write('Failed to configure the build tree!\n') 33 | sys.exit(1) 34 | # build the test project 35 | exit_code = subprocess.call([CMAKE, '--build', bindir, '--config', CMAKE_BUILD_TYPE], cwd=bindir) 36 | if expect_fail == True: 37 | if exit_code == 0: 38 | sys.stderr.write('Build expected to fail, but it succeeded!\n') 39 | sys.exit(1) 40 | else: 41 | sys.stderr.write('Build failed as expected\n') 42 | exit_code = 0 43 | sys.exit(exit_code) 44 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/gflags_declare_flags.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | DECLARE_string(message); // in gflags_delcare_test.cc 5 | 6 | void print_message() 7 | { 8 | std::cout << FLAGS_message << std::endl; 9 | } 10 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/gflags_declare_test.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | DEFINE_string(message, "", "The message to print"); 4 | void print_message(); // in gflags_declare_flags.cc 5 | 6 | int main(int argc, char **argv) 7 | { 8 | gflags::SetUsageMessage("Test compilation and use of gflags_declare.h"); 9 | gflags::ParseCommandLineFlags(&argc, &argv, true); 10 | print_message(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/gflags_strip_flags_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // --- 31 | // Author: csilvers@google.com (Craig Silverstein) 32 | // 33 | // A simple program that uses STRIP_FLAG_HELP. We'll have a shell 34 | // script that runs 'strings' over this program and makes sure 35 | // that the help string is not in there. 36 | 37 | #include "config_for_unittests.h" 38 | #define STRIP_FLAG_HELP 1 39 | #include 40 | 41 | #include 42 | 43 | using GFLAGS_NAMESPACE::SetUsageMessage; 44 | using GFLAGS_NAMESPACE::ParseCommandLineFlags; 45 | 46 | 47 | DEFINE_bool(test, true, "This text should be stripped out"); 48 | 49 | int main(int argc, char** argv) { 50 | SetUsageMessage("Usage message"); 51 | ParseCommandLineFlags(&argc, &argv, false); 52 | 53 | // Unfortunately, for us, libtool can replace executables with a shell 54 | // script that does some work before calling the 'real' executable 55 | // under a different name. We need the 'real' executable name to run 56 | // 'strings' on it, so we construct this binary to print the real 57 | // name (argv[0]) on stdout when run. 58 | puts(argv[0]); 59 | 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/gflags_strip_flags_test.cmake: -------------------------------------------------------------------------------- 1 | if (NOT BINARY) 2 | message (FATAl_ERROR "BINARY file to check not specified!") 3 | endif () 4 | file (STRINGS "${BINARY}" strings REGEX "This text should be stripped out") 5 | if (strings) 6 | message (FATAL_ERROR "Text not stripped from binary like it should be: ${BINARY}") 7 | endif () -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/gflags_unittest_flagfile: -------------------------------------------------------------------------------- 1 | --test_flag=1 2 | --test_flag=2 3 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/nc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## gflags negative compilation tests 2 | 3 | cmake_minimum_required (VERSION 2.8) 4 | 5 | if (NOT TEST_NAME) 6 | message (FATAL_ERROR "Missing TEST_NAME CMake flag") 7 | endif () 8 | string (TOUPPER ${TEST_NAME} TEST_NAME_UPPER) 9 | 10 | project (gflags_${TEST_NAME}) 11 | 12 | find_package (gflags REQUIRED) 13 | include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/..") 14 | add_definitions (-DTEST_${TEST_NAME_UPPER}) 15 | add_executable (gflags_${TEST_NAME} gflags_nc.cc) 16 | target_link_libraries(gflags_${TEST_NAME} ${gflags_LIBRARIES}) 17 | -------------------------------------------------------------------------------- /third-party/gflags-2.1.2/gflags/test/nc/gflags_nc.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // --- 31 | // 32 | // A negative comiple test for gflags. 33 | 34 | #include 35 | 36 | #if defined(TEST_NC_SWAPPED_ARGS) 37 | 38 | DEFINE_bool(some_bool_flag, 39 | "the default value should go here, not the description", 40 | false); 41 | 42 | 43 | #elif defined(TEST_NC_INT_INSTEAD_OF_BOOL) 44 | 45 | DEFINE_bool(some_bool_flag_2, 46 | 0, 47 | "should have been an int32 flag but mistakenly used bool instead"); 48 | 49 | #elif defined(TEST_NC_BOOL_IN_QUOTES) 50 | 51 | 52 | DEFINE_bool(some_bool_flag_3, 53 | "false", 54 | "false in in quotes, which is wrong"); 55 | 56 | #elif defined(TEST_NC_SANITY) 57 | 58 | DEFINE_bool(some_bool_flag_4, 59 | true, 60 | "this is the correct usage of DEFINE_bool"); 61 | 62 | #elif defined(TEST_NC_DEFINE_STRING_WITH_0) 63 | 64 | DEFINE_string(some_string_flag, 65 | 0, 66 | "Trying to construct a string by passing 0 would cause a crash."); 67 | 68 | #endif 69 | 70 | int main(int, char **) 71 | { 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/.gitignore: -------------------------------------------------------------------------------- 1 | autom4te.cache 2 | glog-*.tar.gz 3 | packages/rpm-unknown 4 | packages/debian-* 5 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of glog authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | # 5 | # Names should be added to this file as: 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | # 9 | # Please keep the list sorted. 10 | 11 | Abhishek Parmar 12 | Brian Silverman 13 | Google Inc. 14 | Michael Tanner 15 | romange 16 | Sergiu Dotenco 17 | tbennun 18 | Teddy Reed 19 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute # 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | a just a few small guidelines you need to follow. 5 | 6 | 7 | ## Contributor License Agreement ## 8 | 9 | Contributions to any Google project must be accompanied by a Contributor 10 | License Agreement. This is not a copyright **assignment**, it simply gives 11 | Google permission to use and redistribute your contributions as part of the 12 | project. 13 | 14 | * If you are an individual writing original source code and you're sure you 15 | own the intellectual property, then you'll need to sign an [individual 16 | CLA][]. 17 | 18 | * If you work for a company that wants to allow you to contribute your work, 19 | then you'll need to sign a [corporate CLA][]. 20 | 21 | You generally only need to submit a CLA once, so if you've already submitted 22 | one (even if it was for a different project), you probably don't need to do it 23 | again. 24 | 25 | [individual CLA]: https://developers.google.com/open-source/cla/individual 26 | [corporate CLA]: https://developers.google.com/open-source/cla/corporate 27 | 28 | Once your CLA is submitted (or if you already submitted one for 29 | another Google project), make a commit adding yourself to the 30 | [AUTHORS][] and [CONTRIBUTORS][] files. This commit can be part 31 | of your first [pull request][]. 32 | 33 | [AUTHORS]: AUTHORS 34 | [CONTRIBUTORS]: CONTRIBUTORS 35 | 36 | 37 | ## Submitting a patch ## 38 | 39 | 1. It's generally best to start by opening a new issue describing the bug or 40 | feature you're intending to fix. Even if you think it's relatively minor, 41 | it's helpful to know what people are working on. Mention in the initial 42 | issue that you are planning to work on that bug or feature so that it can 43 | be assigned to you. 44 | 45 | 1. Follow the normal process of [forking][] the project, and setup a new 46 | branch to work in. It's important that each group of changes be done in 47 | separate branches in order to ensure that a pull request only includes the 48 | commits related to that bug or feature. 49 | 50 | 1. Do your best to have [well-formed commit messages][] for each change. 51 | This provides consistency throughout the project, and ensures that commit 52 | messages are able to be formatted properly by various git tools. 53 | 54 | 1. Finally, push the commits to your fork and submit a [pull request][]. 55 | 56 | [forking]: https://help.github.com/articles/fork-a-repo 57 | [well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html 58 | [pull request]: https://help.github.com/articles/creating-a-pull-request 59 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # People who have agreed to one of the CLAs and can contribute patches. 2 | # The AUTHORS file lists the copyright holders; this file 3 | # lists people. For example, Google employees are listed here 4 | # but not in AUTHORS, because Google holds the copyright. 5 | # 6 | # Names should be added to this file only after verifying that 7 | # the individual or the individual's organization has agreed to 8 | # the appropriate Contributor License Agreement, found here: 9 | # 10 | # https://developers.google.com/open-source/cla/individual 11 | # https://developers.google.com/open-source/cla/corporate 12 | # 13 | # The agreement for individuals can be filled out on the web. 14 | # 15 | # When adding J Random Contributor's name to this file, 16 | # either J's name or J's organization's name should be 17 | # added to the AUTHORS file, depending on whether the 18 | # individual or corporate CLA was used. 19 | # 20 | # Names should be added to this file as: 21 | # Name 22 | # 23 | # Please keep the list sorted. 24 | 25 | Abhishek Parmar 26 | Brian Silverman 27 | Fumitoshi Ukai 28 | Håkan L. S. Younes 29 | Ivan Penkov 30 | Michael Tanner 31 | romange 32 | Sergiu Dotenco 33 | Shinichiro Hamaji 34 | tbennun 35 | Teddy Reed 36 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | A function gettimeofday in utilities.cc is based on 32 | 33 | http://www.google.com/codesearch/p?hl=en#dR3YEbitojA/COPYING&q=GetSystemTimeAsFileTime%20license:bsd 34 | 35 | The license of this code is: 36 | 37 | Copyright (c) 2003-2008, Jouni Malinen and contributors 38 | All Rights Reserved. 39 | 40 | Redistribution and use in source and binary forms, with or without 41 | modification, are permitted provided that the following conditions are 42 | met: 43 | 44 | 1. Redistributions of source code must retain the above copyright 45 | notice, this list of conditions and the following disclaimer. 46 | 47 | 2. Redistributions in binary form must reproduce the above copyright 48 | notice, this list of conditions and the following disclaimer in the 49 | documentation and/or other materials provided with the distribution. 50 | 51 | 3. Neither the name(s) of the above-listed copyright holder(s) nor the 52 | names of its contributors may be used to endorse or promote products 53 | derived from this software without specific prior written permission. 54 | 55 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 56 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 57 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 58 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 59 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 60 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 61 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 62 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 63 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 64 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 65 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 66 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/ChangeLog: -------------------------------------------------------------------------------- 1 | 2013-02-01 Google Inc. 2 | 3 | * google-glog: version 0.3.3 4 | * Add --disable-rtti option for configure. 5 | * Visual Studio build and test fix. 6 | * QNX build fix (thanks vanuan). 7 | * Reduce warnings. 8 | * Fixed LOG_SYSRESULT (thanks ukai). 9 | * FreeBSD build fix (thanks yyanagisawa). 10 | * Clang build fix. 11 | * Now users can re-initialize glog after ShutdownGoogleLogging. 12 | * Color output support by GLOG_colorlogtostderr (thanks alexs). 13 | * Now glog's ABI around flags are compatible with gflags. 14 | * Document mentions how to modify flags from user programs. 15 | 16 | 2012-01-12 Google Inc. 17 | 18 | * google-glog: version 0.3.2 19 | * Clang support. 20 | * Demangler and stacktrace improvement for newer GCCs. 21 | * Now fork(2) doesn't mess up log files. 22 | * Make valgrind happier. 23 | * Reduce warnings for more -W options. 24 | * Provide a workaround for ERROR defined by windows.h. 25 | 26 | 2010-06-15 Google Inc. 27 | 28 | * google-glog: version 0.3.1 29 | * GLOG_* environment variables now work even when gflags is installed. 30 | * Snow leopard support. 31 | * Now we can build and test from out side tree. 32 | * Add DCHECK_NOTNULL. 33 | * Add ShutdownGoogleLogging to close syslog (thanks DGunchev) 34 | * Fix --enable-frame-pointers option (thanks kazuki.ohta) 35 | * Fix libunwind detection (thanks giantchen) 36 | 37 | 2009-07-30 Google Inc. 38 | 39 | * google-glog: version 0.3.0 40 | * Fix a deadlock happened when user uses glog with recent gflags. 41 | * Suppress several unnecessary warnings (thanks keir). 42 | * NetBSD and OpenBSD support. 43 | * Use Win32API GetComputeNameA properly (thanks magila). 44 | * Fix user name detection for Windows (thanks ademin). 45 | * Fix several minor bugs. 46 | 47 | 2009-04-10 Google Inc. 48 | * google-glog: version 0.2.1 49 | * Fix timestamps of VC++ version. 50 | * Add pkg-config support (thanks Tomasz) 51 | * Fix build problem when building with gtest (thanks Michael) 52 | * Add --with-gflags option for configure (thanks Michael) 53 | * Fixes for GCC 4.4 (thanks John) 54 | 55 | 2009-01-23 Google Inc. 56 | * google-glog: version 0.2 57 | * Add initial Windows VC++ support. 58 | * Google testing/mocking frameworks integration. 59 | * Link pthread library automatically. 60 | * Flush logs in signal handlers. 61 | * Add macros LOG_TO_STRING, LOG_AT_LEVEL, DVLOG, and LOG_TO_SINK_ONLY. 62 | * Log microseconds. 63 | * Add --log_backtrace_at option. 64 | * Fix some minor bugs. 65 | 66 | 2008-11-18 Google Inc. 67 | * google-glog: version 0.1.2 68 | * Add InstallFailureSignalHandler(). (satorux) 69 | * Re-organize the way to produce stacktraces. 70 | * Don't define unnecessary macro DISALLOW_EVIL_CONSTRUCTORS. 71 | 72 | 2008-10-15 Google Inc. 73 | * google-glog: version 0.1.1 74 | * Support symbolize for MacOSX 10.5. 75 | * BUG FIX: --vmodule didn't work with gflags. 76 | * BUG FIX: symbolize_unittest failed with GCC 4.3. 77 | * Several fixes on the document. 78 | 79 | 2008-10-07 Google Inc. 80 | 81 | * google-glog: initial release: 82 | The glog package contains a library that implements application-level 83 | logging. This library provides logging APIs based on C++-style 84 | streams and various helper macros. 85 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfu-dis/bztree/b2e7fcb5c70ac79b577a1d0e5d30a4b6207d6464/third-party/glog-0.3.4/NEWS -------------------------------------------------------------------------------- /third-party/glog-0.3.4/README: -------------------------------------------------------------------------------- 1 | This repository contains a C++ implementation of the Google logging 2 | module. Documentation for the implementation is in doc/. 3 | 4 | See INSTALL for (generic) installation instructions for C++: basically 5 | ./configure && make && make install 6 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/README.windows: -------------------------------------------------------------------------------- 1 | This project has begun being ported to Windows. A working solution 2 | file exists in this directory: 3 | google-glog.sln 4 | 5 | You can load this solution file into VC++ 9.0 (Visual Studio 6 | 2008). You may also be able to use this solution file with older 7 | Visual Studios by converting the solution file. 8 | 9 | Note that stack tracing and some unittests are not ported 10 | yet. 11 | 12 | You can also link glog code in statically -- see the example project 13 | libglog_static and logging_unittest_static, which does this. For this 14 | to work, you'll need to add "/D GOOGLE_GLOG_DLL_DECL=" to the compile 15 | line of every glog's .cc file. 16 | 17 | I have little experience with Windows programming, so there may be 18 | better ways to set this up than I've done! If you run across any 19 | problems, please post to the google-glog Google Group, or report 20 | them on the google-glog Google Code site: 21 | http://groups.google.com/group/google-glog 22 | https://github.com/google/glog/issues 23 | 24 | -- Shinichiro Hamaji 25 | 26 | Last modified: 23 January 2009 27 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/cmake/DetermineGflagsNamespace.cmake: -------------------------------------------------------------------------------- 1 | macro(determine_gflags_namespace VARIABLE) 2 | if (NOT DEFINED "${VARIABLE}") 3 | if (CMAKE_REQUIRED_INCLUDES) 4 | set (CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}") 5 | else () 6 | set (CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS) 7 | endif () 8 | 9 | set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS}) 10 | 11 | set(_NAMESPACES gflags google) 12 | set(_check_code 13 | " 14 | #include 15 | 16 | int main(int argc, char**argv) 17 | { 18 | GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true); 19 | } 20 | ") 21 | if (NOT CMAKE_REQUIRED_QUIET) 22 | message (STATUS "Looking for gflags namespace") 23 | endif () 24 | if (${ARGC} EQUAL 3) 25 | set (CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS}) 26 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}") 27 | endif () 28 | 29 | set (_check_file 30 | ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/DetermineGflagsNamespace.cxx) 31 | 32 | foreach (_namespace ${_NAMESPACES}) 33 | file (WRITE "${_check_file}" "${_check_code}") 34 | try_compile (${VARIABLE} 35 | "${CMAKE_BINARY_DIR}" "${_check_file}" 36 | COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}" -DGFLAGS_NAMESPACE=${_namespace} 37 | LINK_LIBRARIES "${gflags_LIBRARIES}" 38 | CMAKE_FLAGS -DINCLUDE_DIRECTORIES:STRING="${gflags_INCLUDE_DIR}" 39 | OUTPUT_VARIABLE OUTPUT) 40 | 41 | if (${VARIABLE}) 42 | set (${VARIABLE} ${_namespace} CACHE INTERNAL "gflags namespace" FORCE) 43 | break () 44 | else () 45 | file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 46 | "Determining the gflags namespace ${_namespace} failed with the following output:\n" 47 | "${OUTPUT}\n\n") 48 | endif () 49 | endforeach (_namespace) 50 | 51 | if (${ARGC} EQUAL 3) 52 | set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE}) 53 | endif () 54 | 55 | if (${VARIABLE}) 56 | if (NOT CMAKE_REQUIRED_QUIET) 57 | message (STATUS "Looking for gflags namespace - ${${VARIABLE}}") 58 | endif () 59 | file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 60 | "Determining the gflags namespace passed with the following output:\n" 61 | "${OUTPUT}\n\n") 62 | else () 63 | if (NOT CMAKE_REQUIRED_QUIET) 64 | message (STATUS "Looking for gflags namespace - failed") 65 | endif () 66 | set (${VARIABLE} ${_namespace} CACHE INTERNAL "gflags namespace") 67 | endif () 68 | endif () 69 | endmacro () 70 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/compile: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Wrapper for compilers which do not understand `-c -o'. 4 | 5 | # Copyright 1999, 2000 Free Software Foundation, Inc. 6 | # Written by Tom Tromey . 7 | # 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2, or (at your option) 11 | # any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | # Usage: 28 | # compile PROGRAM [ARGS]... 29 | # `-o FOO.o' is removed from the args passed to the actual compile. 30 | 31 | prog=$1 32 | shift 33 | 34 | ofile= 35 | cfile= 36 | args= 37 | while test $# -gt 0; do 38 | case "$1" in 39 | -o) 40 | # configure might choose to run compile as `compile cc -o foo foo.c'. 41 | # So we do something ugly here. 42 | ofile=$2 43 | shift 44 | case "$ofile" in 45 | *.o | *.obj) 46 | ;; 47 | *) 48 | args="$args -o $ofile" 49 | ofile= 50 | ;; 51 | esac 52 | ;; 53 | *.c) 54 | cfile=$1 55 | args="$args $1" 56 | ;; 57 | *) 58 | args="$args $1" 59 | ;; 60 | esac 61 | shift 62 | done 63 | 64 | if test -z "$ofile" || test -z "$cfile"; then 65 | # If no `-o' option was seen then we might have been invoked from a 66 | # pattern rule where we don't need one. That is ok -- this is a 67 | # normal compilation that the losing compiler can handle. If no 68 | # `.c' file was seen then we are probably linking. That is also 69 | # ok. 70 | exec "$prog" $args 71 | fi 72 | 73 | # Name of file we expect compiler to create. 74 | cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` 75 | 76 | # Create the lock directory. 77 | # Note: use `[/.-]' here to ensure that we don't use the same name 78 | # that we are using for the .o file. Also, base the name on the expected 79 | # object file name, since that is what matters with a parallel build. 80 | lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d 81 | while true; do 82 | if mkdir $lockdir > /dev/null 2>&1; then 83 | break 84 | fi 85 | sleep 1 86 | done 87 | # FIXME: race condition here if user kills between mkdir and trap. 88 | trap "rmdir $lockdir; exit 1" 1 2 15 89 | 90 | # Run the compile. 91 | "$prog" $args 92 | status=$? 93 | 94 | if test -f "$cofile"; then 95 | mv "$cofile" "$ofile" 96 | fi 97 | 98 | rmdir $lockdir 99 | exit $status 100 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/doc/designstyle.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #ffffff; 3 | color: black; 4 | margin-right: 1in; 5 | margin-left: 1in; 6 | } 7 | 8 | 9 | h1, h2, h3, h4, h5, h6 { 10 | color: #3366ff; 11 | font-family: sans-serif; 12 | } 13 | @media print { 14 | /* Darker version for printing */ 15 | h1, h2, h3, h4, h5, h6 { 16 | color: #000080; 17 | font-family: helvetica, sans-serif; 18 | } 19 | } 20 | 21 | h1 { 22 | text-align: center; 23 | font-size: 18pt; 24 | } 25 | h2 { 26 | margin-left: -0.5in; 27 | } 28 | h3 { 29 | margin-left: -0.25in; 30 | } 31 | h4 { 32 | margin-left: -0.125in; 33 | } 34 | hr { 35 | margin-left: -1in; 36 | } 37 | 38 | /* Definition lists: definition term bold */ 39 | dt { 40 | font-weight: bold; 41 | } 42 | 43 | address { 44 | text-align: right; 45 | } 46 | /* Use the tag for bits of code and for variables and objects. */ 47 | code,pre,samp,var { 48 | color: #006000; 49 | } 50 | /* Use the tag for file and directory paths and names. */ 51 | file { 52 | color: #905050; 53 | font-family: monospace; 54 | } 55 | /* Use the tag for stuff the user should type. */ 56 | kbd { 57 | color: #600000; 58 | } 59 | div.note p { 60 | float: right; 61 | width: 3in; 62 | margin-right: 0%; 63 | padding: 1px; 64 | border: 2px solid #6060a0; 65 | background-color: #fffff0; 66 | } 67 | 68 | UL.nobullets { 69 | list-style-type: none; 70 | list-style-image: none; 71 | margin-left: -1em; 72 | } 73 | 74 | /* 75 | body:after { 76 | content: "Google Confidential"; 77 | } 78 | */ 79 | 80 | /* pretty printing styles. See prettify.js */ 81 | .str { color: #080; } 82 | .kwd { color: #008; } 83 | .com { color: #800; } 84 | .typ { color: #606; } 85 | .lit { color: #066; } 86 | .pun { color: #660; } 87 | .pln { color: #000; } 88 | .tag { color: #008; } 89 | .atn { color: #606; } 90 | .atv { color: #080; } 91 | pre.prettyprint { padding: 2px; border: 1px solid #888; } 92 | 93 | .embsrc { background: #eee; } 94 | 95 | @media print { 96 | .str { color: #060; } 97 | .kwd { color: #006; font-weight: bold; } 98 | .com { color: #600; font-style: italic; } 99 | .typ { color: #404; font-weight: bold; } 100 | .lit { color: #044; } 101 | .pun { color: #440; } 102 | .pln { color: #000; } 103 | .tag { color: #006; font-weight: bold; } 104 | .atn { color: #404; } 105 | .atv { color: #060; } 106 | } 107 | 108 | /* Table Column Headers */ 109 | .hdr { 110 | color: #006; 111 | font-weight: bold; 112 | background-color: #dddddd; } 113 | .hdr2 { 114 | color: #006; 115 | background-color: #eeeeee; } -------------------------------------------------------------------------------- /third-party/glog-0.3.4/glog-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake") 4 | set_and_check (glog_INCLUDE_DIR "@PACKAGE_glog_INCLUDE_DIR@") 5 | 6 | @glog_PACKAGE_DEPS@ 7 | 8 | set (glog_LIBRARY glog) 9 | 10 | set (glog_LIBRARIES ${glog_LIBRARY}) 11 | set (glog_INCLUDE_DIRS ${glog_INCLUDE_DIR}) 12 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/google-glog.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libglog", "vsprojects\libglog\libglog.vcproj", "{34BD04BD-BC1D-4BFC-AAFC-ED02D9E960F1}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logging_unittest", "vsprojects\logging_unittest\logging_unittest.vcproj", "{DD0690AA-5E09-46B5-83FD-4B28604CABA8}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {34BD04BD-BC1D-4BFC-AAFC-ED02D9E960F1} = {34BD04BD-BC1D-4BFC-AAFC-ED02D9E960F1} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libglog_static", "vsprojects\libglog_static\libglog_static.vcproj", "{772C2111-BBBF-49E6-B912-198A7F7A88E5}" 12 | EndProject 13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logging_unittest_static", "vsprojects\logging_unittest_static\logging_unittest_static.vcproj", "{9B239B45-84A9-4E06-AC46-8E220CD43974}" 14 | ProjectSection(ProjectDependencies) = postProject 15 | {772C2111-BBBF-49E6-B912-198A7F7A88E5} = {772C2111-BBBF-49E6-B912-198A7F7A88E5} 16 | EndProjectSection 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Debug|Win32 = Debug|Win32 21 | Release|Win32 = Release|Win32 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {34BD04BD-BC1D-4BFC-AAFC-ED02D9E960F1}.Debug|Win32.ActiveCfg = Debug|Win32 25 | {34BD04BD-BC1D-4BFC-AAFC-ED02D9E960F1}.Debug|Win32.Build.0 = Debug|Win32 26 | {34BD04BD-BC1D-4BFC-AAFC-ED02D9E960F1}.Release|Win32.ActiveCfg = Release|Win32 27 | {34BD04BD-BC1D-4BFC-AAFC-ED02D9E960F1}.Release|Win32.Build.0 = Release|Win32 28 | {DD0690AA-5E09-46B5-83FD-4B28604CABA8}.Debug|Win32.ActiveCfg = Debug|Win32 29 | {DD0690AA-5E09-46B5-83FD-4B28604CABA8}.Debug|Win32.Build.0 = Debug|Win32 30 | {DD0690AA-5E09-46B5-83FD-4B28604CABA8}.Release|Win32.ActiveCfg = Release|Win32 31 | {DD0690AA-5E09-46B5-83FD-4B28604CABA8}.Release|Win32.Build.0 = Release|Win32 32 | {772C2111-BBBF-49E6-B912-198A7F7A88E5}.Debug|Win32.ActiveCfg = Debug|Win32 33 | {772C2111-BBBF-49E6-B912-198A7F7A88E5}.Debug|Win32.Build.0 = Debug|Win32 34 | {772C2111-BBBF-49E6-B912-198A7F7A88E5}.Release|Win32.ActiveCfg = Release|Win32 35 | {772C2111-BBBF-49E6-B912-198A7F7A88E5}.Release|Win32.Build.0 = Release|Win32 36 | {9B239B45-84A9-4E06-AC46-8E220CD43974}.Debug|Win32.ActiveCfg = Debug|Win32 37 | {9B239B45-84A9-4E06-AC46-8E220CD43974}.Debug|Win32.Build.0 = Debug|Win32 38 | {9B239B45-84A9-4E06-AC46-8E220CD43974}.Release|Win32.ActiveCfg = Release|Win32 39 | {9B239B45-84A9-4E06-AC46-8E220CD43974}.Release|Win32.Build.0 = Release|Win32 40 | EndGlobalSection 41 | GlobalSection(SolutionProperties) = preSolution 42 | HideSolutionNode = FALSE 43 | EndGlobalSection 44 | EndGlobal 45 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/libglog.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libglog 7 | Description: Google Log (glog) C++ logging framework 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lglog 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/ac_have_attribute.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AX_C___ATTRIBUTE__], [ 2 | AC_MSG_CHECKING(for __attribute__) 3 | AC_CACHE_VAL(ac_cv___attribute__, [ 4 | AC_TRY_COMPILE( 5 | [#include 6 | static void foo(void) __attribute__ ((unused)); 7 | void foo(void) { exit(1); }], 8 | [], 9 | ac_cv___attribute__=yes, 10 | ac_cv___attribute__=no 11 | )]) 12 | if test "$ac_cv___attribute__" = "yes"; then 13 | AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__]) 14 | fi 15 | AC_MSG_RESULT($ac_cv___attribute__) 16 | ]) 17 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/ac_have_builtin_expect.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AX_C___BUILTIN_EXPECT], [ 2 | AC_MSG_CHECKING(for __builtin_expect) 3 | AC_CACHE_VAL(ac_cv___builtin_expect, [ 4 | AC_TRY_COMPILE( 5 | [int foo(void) { if (__builtin_expect(0, 0)) return 1; return 0; }], 6 | [], 7 | ac_cv___builtin_expect=yes, 8 | ac_cv___builtin_expect=no 9 | )]) 10 | if test "$ac_cv___builtin_expect" = "yes"; then 11 | AC_DEFINE(HAVE___BUILTIN_EXPECT, 1, [define if your compiler has __builtin_expect]) 12 | fi 13 | AC_MSG_RESULT($ac_cv___builtin_expect) 14 | ]) 15 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/ac_have_sync_val_compare_and_swap.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AX_C___SYNC_VAL_COMPARE_AND_SWAP], [ 2 | AC_MSG_CHECKING(for __sync_val_compare_and_swap) 3 | AC_CACHE_VAL(ac_cv___sync_val_compare_and_swap, [ 4 | AC_TRY_LINK( 5 | [], 6 | [int a; if (__sync_val_compare_and_swap(&a, 0, 1)) return 1; return 0;], 7 | ac_cv___sync_val_compare_and_swap=yes, 8 | ac_cv___sync_val_compare_and_swap=no 9 | )]) 10 | if test "$ac_cv___sync_val_compare_and_swap" = "yes"; then 11 | AC_DEFINE(HAVE___SYNC_VAL_COMPARE_AND_SWAP, 1, [define if your compiler has __sync_val_compare_and_swap]) 12 | fi 13 | AC_MSG_RESULT($ac_cv___sync_val_compare_and_swap) 14 | ]) 15 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/ac_rwlock.m4: -------------------------------------------------------------------------------- 1 | # TODO(csilvers): it would be better to actually try to link against 2 | # -pthreads, to make sure it defines these methods, but that may be 3 | # too hard, since pthread support is really tricky. 4 | 5 | # Check for support for pthread_rwlock_init() etc. 6 | # These aren't posix, but are widely supported. To get them on linux, 7 | # you need to define _XOPEN_SOURCE first, so this check assumes your 8 | # application does that. 9 | # 10 | # Note: OS X (as of 6/1/06) seems to support pthread_rwlock, but 11 | # doesn't define PTHREAD_RWLOCK_INITIALIZER. Therefore, we don't test 12 | # that particularly macro. It's probably best if you don't use that 13 | # macro in your code either. 14 | 15 | AC_DEFUN([AC_RWLOCK], 16 | [AC_CACHE_CHECK(support for pthread_rwlock_* functions, 17 | ac_cv_rwlock, 18 | [AC_LANG_SAVE 19 | AC_LANG_C 20 | AC_TRY_COMPILE([#define _XOPEN_SOURCE 500 21 | #include ], 22 | [pthread_rwlock_t l; pthread_rwlock_init(&l, NULL); 23 | pthread_rwlock_rdlock(&l); 24 | return 0;], 25 | ac_cv_rwlock=yes, ac_cv_rwlock=no) 26 | AC_LANG_RESTORE 27 | ]) 28 | if test "$ac_cv_rwlock" = yes; then 29 | AC_DEFINE(HAVE_RWLOCK,1,[define if the compiler implements pthread_rwlock_*]) 30 | fi 31 | ]) 32 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/google_namespace.m4: -------------------------------------------------------------------------------- 1 | # Allow users to override the namespace we define our application's classes in 2 | # Arg $1 is the default namespace to use if --enable-namespace isn't present. 3 | 4 | # In general, $1 should be 'google', so we put all our exported symbols in a 5 | # unique namespace that is not likely to conflict with anyone else. However, 6 | # when it makes sense -- for instance, when publishing stl-like code -- you 7 | # may want to go with a different default, like 'std'. 8 | 9 | AC_DEFUN([AC_DEFINE_GOOGLE_NAMESPACE], 10 | [google_namespace_default=[$1] 11 | AC_ARG_ENABLE(namespace, [ --enable-namespace=FOO to define these Google 12 | classes in the FOO namespace. --disable-namespace 13 | to define them in the global namespace. Default 14 | is to define them in namespace $1.], 15 | [case "$enableval" in 16 | yes) google_namespace="$google_namespace_default" ;; 17 | no) google_namespace="" ;; 18 | *) google_namespace="$enableval" ;; 19 | esac], 20 | [google_namespace="$google_namespace_default"]) 21 | if test -n "$google_namespace"; then 22 | ac_google_namespace="$google_namespace" 23 | ac_google_start_namespace="namespace $google_namespace {" 24 | ac_google_end_namespace="}" 25 | else 26 | ac_google_namespace="" 27 | ac_google_start_namespace="" 28 | ac_google_end_namespace="" 29 | fi 30 | AC_DEFINE_UNQUOTED(GOOGLE_NAMESPACE, $ac_google_namespace, 31 | Namespace for Google classes) 32 | AC_DEFINE_UNQUOTED(_START_GOOGLE_NAMESPACE_, $ac_google_start_namespace, 33 | Puts following code inside the Google namespace) 34 | AC_DEFINE_UNQUOTED(_END_GOOGLE_NAMESPACE_, $ac_google_end_namespace, 35 | Stops putting the code inside the Google namespace) 36 | ]) 37 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/ltsugar.m4: -------------------------------------------------------------------------------- 1 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. 4 | # Written by Gary V. Vaughan, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 6 ltsugar.m4 11 | 12 | # This is to help aclocal find these macros, as it can't see m4_define. 13 | AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) 14 | 15 | 16 | # lt_join(SEP, ARG1, [ARG2...]) 17 | # ----------------------------- 18 | # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their 19 | # associated separator. 20 | # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier 21 | # versions in m4sugar had bugs. 22 | m4_define([lt_join], 23 | [m4_if([$#], [1], [], 24 | [$#], [2], [[$2]], 25 | [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) 26 | m4_define([_lt_join], 27 | [m4_if([$#$2], [2], [], 28 | [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) 29 | 30 | 31 | # lt_car(LIST) 32 | # lt_cdr(LIST) 33 | # ------------ 34 | # Manipulate m4 lists. 35 | # These macros are necessary as long as will still need to support 36 | # Autoconf-2.59 which quotes differently. 37 | m4_define([lt_car], [[$1]]) 38 | m4_define([lt_cdr], 39 | [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], 40 | [$#], 1, [], 41 | [m4_dquote(m4_shift($@))])]) 42 | m4_define([lt_unquote], $1) 43 | 44 | 45 | # lt_append(MACRO-NAME, STRING, [SEPARATOR]) 46 | # ------------------------------------------ 47 | # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. 48 | # Note that neither SEPARATOR nor STRING are expanded; they are appended 49 | # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). 50 | # No SEPARATOR is output if MACRO-NAME was previously undefined (different 51 | # than defined and empty). 52 | # 53 | # This macro is needed until we can rely on Autoconf 2.62, since earlier 54 | # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. 55 | m4_define([lt_append], 56 | [m4_define([$1], 57 | m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) 58 | 59 | 60 | 61 | # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) 62 | # ---------------------------------------------------------- 63 | # Produce a SEP delimited list of all paired combinations of elements of 64 | # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list 65 | # has the form PREFIXmINFIXSUFFIXn. 66 | # Needed until we can rely on m4_combine added in Autoconf 2.62. 67 | m4_define([lt_combine], 68 | [m4_if(m4_eval([$# > 3]), [1], 69 | [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl 70 | [[m4_foreach([_Lt_prefix], [$2], 71 | [m4_foreach([_Lt_suffix], 72 | ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, 73 | [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) 74 | 75 | 76 | # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) 77 | # ----------------------------------------------------------------------- 78 | # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited 79 | # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. 80 | m4_define([lt_if_append_uniq], 81 | [m4_ifdef([$1], 82 | [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], 83 | [lt_append([$1], [$2], [$3])$4], 84 | [$5])], 85 | [lt_append([$1], [$2], [$3])$4])]) 86 | 87 | 88 | # lt_dict_add(DICT, KEY, VALUE) 89 | # ----------------------------- 90 | m4_define([lt_dict_add], 91 | [m4_define([$1($2)], [$3])]) 92 | 93 | 94 | # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) 95 | # -------------------------------------------- 96 | m4_define([lt_dict_add_subkey], 97 | [m4_define([$1($2:$3)], [$4])]) 98 | 99 | 100 | # lt_dict_fetch(DICT, KEY, [SUBKEY]) 101 | # ---------------------------------- 102 | m4_define([lt_dict_fetch], 103 | [m4_ifval([$3], 104 | m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), 105 | m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) 106 | 107 | 108 | # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) 109 | # ----------------------------------------------------------------- 110 | m4_define([lt_if_dict_fetch], 111 | [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], 112 | [$5], 113 | [$6])]) 114 | 115 | 116 | # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) 117 | # -------------------------------------------------------------- 118 | m4_define([lt_dict_filter], 119 | [m4_if([$5], [], [], 120 | [lt_join(m4_quote(m4_default([$4], [[, ]])), 121 | lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), 122 | [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl 123 | ]) 124 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/namespaces.m4: -------------------------------------------------------------------------------- 1 | # Checks whether the compiler implements namespaces 2 | AC_DEFUN([AC_CXX_NAMESPACES], 3 | [AC_CACHE_CHECK(whether the compiler implements namespaces, 4 | ac_cv_cxx_namespaces, 5 | [AC_LANG_SAVE 6 | AC_LANG_CPLUSPLUS 7 | AC_TRY_COMPILE([namespace Outer { 8 | namespace Inner { int i = 0; }}], 9 | [using namespace Outer::Inner; return i;], 10 | ac_cv_cxx_namespaces=yes, 11 | ac_cv_cxx_namespaces=no) 12 | AC_LANG_RESTORE]) 13 | if test "$ac_cv_cxx_namespaces" = yes; then 14 | AC_DEFINE(HAVE_NAMESPACES, 1, [define if the compiler implements namespaces]) 15 | fi]) 16 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/pc_from_ucontext.m4: -------------------------------------------------------------------------------- 1 | # We want to access the "PC" (Program Counter) register from a struct 2 | # ucontext. Every system has its own way of doing that. We try all the 3 | # possibilities we know about. Note REG_PC should come first (REG_RIP 4 | # is also defined on solaris, but does the wrong thing). 5 | 6 | # OpenBSD doesn't have ucontext.h, but we can get PC from ucontext_t 7 | # by using signal.h. 8 | 9 | # The first argument of AC_PC_FROM_UCONTEXT will be invoked when we 10 | # cannot find a way to obtain PC from ucontext. 11 | 12 | AC_DEFUN([AC_PC_FROM_UCONTEXT], 13 | [AC_CHECK_HEADERS(ucontext.h) 14 | AC_CHECK_HEADERS(sys/ucontext.h) # ucontext on OS X 10.6 (at least) 15 | AC_MSG_CHECKING([how to access the program counter from a struct ucontext]) 16 | pc_fields=" uc_mcontext.gregs[[REG_PC]]" # Solaris x86 (32 + 64 bit) 17 | pc_fields="$pc_fields uc_mcontext.gregs[[REG_EIP]]" # Linux (i386) 18 | pc_fields="$pc_fields uc_mcontext.gregs[[REG_RIP]]" # Linux (x86_64) 19 | pc_fields="$pc_fields uc_mcontext.sc_ip" # Linux (ia64) 20 | pc_fields="$pc_fields uc_mcontext.uc_regs->gregs[[PT_NIP]]" # Linux (ppc) 21 | pc_fields="$pc_fields uc_mcontext.gregs[[R15]]" # Linux (arm old [untested]) 22 | pc_fields="$pc_fields uc_mcontext.arm_pc" # Linux (arm new [untested]) 23 | pc_fields="$pc_fields uc_mcontext.mc_eip" # FreeBSD (i386) 24 | pc_fields="$pc_fields uc_mcontext.mc_rip" # FreeBSD (x86_64 [untested]) 25 | pc_fields="$pc_fields uc_mcontext.__gregs[[_REG_EIP]]" # NetBSD (i386) 26 | pc_fields="$pc_fields uc_mcontext.__gregs[[_REG_RIP]]" # NetBSD (x86_64) 27 | pc_fields="$pc_fields uc_mcontext->ss.eip" # OS X (i386, <=10.4) 28 | pc_fields="$pc_fields uc_mcontext->__ss.__eip" # OS X (i386, >=10.5) 29 | pc_fields="$pc_fields uc_mcontext->ss.rip" # OS X (x86_64) 30 | pc_fields="$pc_fields uc_mcontext->__ss.__rip" # OS X (>=10.5 [untested]) 31 | pc_fields="$pc_fields uc_mcontext->ss.srr0" # OS X (ppc, ppc64 [untested]) 32 | pc_fields="$pc_fields uc_mcontext->__ss.__srr0" # OS X (>=10.5 [untested]) 33 | pc_field_found=false 34 | for pc_field in $pc_fields; do 35 | if ! $pc_field_found; then 36 | if test "x$ac_cv_header_sys_ucontext_h" = xyes; then 37 | AC_TRY_COMPILE([#define _GNU_SOURCE 1 38 | #include ], 39 | [ucontext_t u; return u.$pc_field == 0;], 40 | AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field, 41 | How to access the PC from a struct ucontext) 42 | AC_MSG_RESULT([$pc_field]) 43 | pc_field_found=true) 44 | else 45 | AC_TRY_COMPILE([#define _GNU_SOURCE 1 46 | #include ], 47 | [ucontext_t u; return u.$pc_field == 0;], 48 | AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field, 49 | How to access the PC from a struct ucontext) 50 | AC_MSG_RESULT([$pc_field]) 51 | pc_field_found=true) 52 | fi 53 | fi 54 | done 55 | if ! $pc_field_found; then 56 | pc_fields=" sc_eip" # OpenBSD (i386) 57 | pc_fields="$pc_fields sc_rip" # OpenBSD (x86_64) 58 | for pc_field in $pc_fields; do 59 | if ! $pc_field_found; then 60 | AC_TRY_COMPILE([#include ], 61 | [ucontext_t u; return u.$pc_field == 0;], 62 | AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field, 63 | How to access the PC from a struct ucontext) 64 | AC_MSG_RESULT([$pc_field]) 65 | pc_field_found=true) 66 | fi 67 | done 68 | fi 69 | if ! $pc_field_found; then 70 | [$1] 71 | fi]) 72 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/stl_namespace.m4: -------------------------------------------------------------------------------- 1 | # We check what namespace stl code like vector expects to be executed in 2 | 3 | AC_DEFUN([AC_CXX_STL_NAMESPACE], 4 | [AC_CACHE_CHECK( 5 | what namespace STL code is in, 6 | ac_cv_cxx_stl_namespace, 7 | [AC_REQUIRE([AC_CXX_NAMESPACES]) 8 | AC_LANG_SAVE 9 | AC_LANG_CPLUSPLUS 10 | AC_TRY_COMPILE([#include ], 11 | [vector t; return 0;], 12 | ac_cv_cxx_stl_namespace=none) 13 | AC_TRY_COMPILE([#include ], 14 | [std::vector t; return 0;], 15 | ac_cv_cxx_stl_namespace=std) 16 | AC_LANG_RESTORE]) 17 | if test "$ac_cv_cxx_stl_namespace" = none; then 18 | AC_DEFINE(STL_NAMESPACE,, 19 | [the namespace where STL code like vector<> is defined]) 20 | fi 21 | if test "$ac_cv_cxx_stl_namespace" = std; then 22 | AC_DEFINE(STL_NAMESPACE,std, 23 | [the namespace where STL code like vector<> is defined]) 24 | fi 25 | ]) 26 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/m4/using_operator.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AC_CXX_USING_OPERATOR], 2 | [AC_CACHE_CHECK( 3 | whether compiler supports using ::operator<<, 4 | ac_cv_cxx_using_operator, 5 | [AC_LANG_SAVE 6 | AC_LANG_CPLUSPLUS 7 | AC_TRY_COMPILE([#include 8 | std::ostream& operator<<(std::ostream&, struct s);], 9 | [using ::operator<<; return 0;], 10 | ac_cv_cxx_using_operator=1, 11 | ac_cv_cxx_using_operator=0) 12 | AC_LANG_RESTORE]) 13 | if test "$ac_cv_cxx_using_operator" = 1; then 14 | AC_DEFINE(HAVE_USING_OPERATOR, 1, [define if the compiler supports using expression for operator]) 15 | fi]) 16 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | 4 | scriptversion=2006-05-11.19 5 | 6 | # Original author: Noah Friedman 7 | # Created: 1993-05-16 8 | # Public domain. 9 | # 10 | # This file is maintained in Automake, please report 11 | # bugs to or send patches to 12 | # . 13 | 14 | nl=' 15 | ' 16 | IFS=" "" $nl" 17 | errstatus=0 18 | dirmode= 19 | 20 | usage="\ 21 | Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... 22 | 23 | Create each directory DIR (with mode MODE, if specified), including all 24 | leading file name components. 25 | 26 | Report bugs to ." 27 | 28 | # process command line arguments 29 | while test $# -gt 0 ; do 30 | case $1 in 31 | -h | --help | --h*) # -h for help 32 | echo "$usage" 33 | exit $? 34 | ;; 35 | -m) # -m PERM arg 36 | shift 37 | test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } 38 | dirmode=$1 39 | shift 40 | ;; 41 | --version) 42 | echo "$0 $scriptversion" 43 | exit $? 44 | ;; 45 | --) # stop option processing 46 | shift 47 | break 48 | ;; 49 | -*) # unknown option 50 | echo "$usage" 1>&2 51 | exit 1 52 | ;; 53 | *) # first non-opt arg 54 | break 55 | ;; 56 | esac 57 | done 58 | 59 | for file 60 | do 61 | if test -d "$file"; then 62 | shift 63 | else 64 | break 65 | fi 66 | done 67 | 68 | case $# in 69 | 0) exit 0 ;; 70 | esac 71 | 72 | # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and 73 | # mkdir -p a/c at the same time, both will detect that a is missing, 74 | # one will create a, then the other will try to create a and die with 75 | # a "File exists" error. This is a problem when calling mkinstalldirs 76 | # from a parallel make. We use --version in the probe to restrict 77 | # ourselves to GNU mkdir, which is thread-safe. 78 | case $dirmode in 79 | '') 80 | if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then 81 | echo "mkdir -p -- $*" 82 | exec mkdir -p -- "$@" 83 | else 84 | # On NextStep and OpenStep, the `mkdir' command does not 85 | # recognize any option. It will interpret all options as 86 | # directories to create, and then abort because `.' already 87 | # exists. 88 | test -d ./-p && rmdir ./-p 89 | test -d ./--version && rmdir ./--version 90 | fi 91 | ;; 92 | *) 93 | if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && 94 | test ! -d ./--version; then 95 | echo "mkdir -m $dirmode -p -- $*" 96 | exec mkdir -m "$dirmode" -p -- "$@" 97 | else 98 | # Clean up after NextStep and OpenStep mkdir. 99 | for d in ./-m ./-p ./--version "./$dirmode"; 100 | do 101 | test -d $d && rmdir $d 102 | done 103 | fi 104 | ;; 105 | esac 106 | 107 | for file 108 | do 109 | case $file in 110 | /*) pathcomp=/ ;; 111 | *) pathcomp= ;; 112 | esac 113 | oIFS=$IFS 114 | IFS=/ 115 | set fnord $file 116 | shift 117 | IFS=$oIFS 118 | 119 | for d 120 | do 121 | test "x$d" = x && continue 122 | 123 | pathcomp=$pathcomp$d 124 | case $pathcomp in 125 | -*) pathcomp=./$pathcomp ;; 126 | esac 127 | 128 | if test ! -d "$pathcomp"; then 129 | echo "mkdir $pathcomp" 130 | 131 | mkdir "$pathcomp" || lasterr=$? 132 | 133 | if test ! -d "$pathcomp"; then 134 | errstatus=$lasterr 135 | else 136 | if test ! -z "$dirmode"; then 137 | echo "chmod $dirmode $pathcomp" 138 | lasterr= 139 | chmod "$dirmode" "$pathcomp" || lasterr=$? 140 | 141 | if test ! -z "$lasterr"; then 142 | errstatus=$lasterr 143 | fi 144 | fi 145 | fi 146 | fi 147 | 148 | pathcomp=$pathcomp/ 149 | done 150 | done 151 | 152 | exit $errstatus 153 | 154 | # Local Variables: 155 | # mode: shell-script 156 | # sh-indentation: 2 157 | # eval: (add-hook 'write-file-hooks 'time-stamp) 158 | # time-stamp-start: "scriptversion=" 159 | # time-stamp-format: "%:y-%02m-%02d.%02H" 160 | # time-stamp-end: "$" 161 | # End: 162 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # This takes one commandline argument, the name of the package. If no 4 | # name is given, then we'll end up just using the name associated with 5 | # an arbitrary .tar.gz file in the rootdir. That's fine: there's probably 6 | # only one. 7 | # 8 | # Run this from the 'packages' directory, just under rootdir 9 | 10 | ## Set LIB to lib if exporting a library, empty-string else 11 | LIB= 12 | #LIB=lib 13 | 14 | PACKAGE="$1" 15 | VERSION="$2" 16 | 17 | # We can only build Debian packages, if the Debian build tools are installed 18 | if [ \! -x /usr/bin/debuild ]; then 19 | echo "Cannot find /usr/bin/debuild. Not building Debian packages." 1>&2 20 | exit 0 21 | fi 22 | 23 | # Double-check we're in the packages directory, just under rootdir 24 | if [ \! -r ../Makefile -a \! -r ../INSTALL ]; then 25 | echo "Must run $0 in the 'packages' directory, under the root directory." 1>&2 26 | echo "Also, you must run \"make dist\" before running this script." 1>&2 27 | exit 0 28 | fi 29 | 30 | # Find the top directory for this package 31 | topdir="${PWD%/*}" 32 | 33 | # Find the tar archive built by "make dist" 34 | archive="$PACKAGE-$VERSION" 35 | if [ -z "${archive}" ]; then 36 | echo "Cannot find ../$PACKAGE*.tar.gz. Run \"make dist\" first." 1>&2 37 | exit 0 38 | fi 39 | 40 | # Create a pristine directory for building the Debian package files 41 | trap 'rm -rf '`pwd`/tmp'; exit $?' EXIT SIGHUP SIGINT SIGTERM 42 | 43 | rm -rf tmp 44 | mkdir -p tmp 45 | cd tmp 46 | 47 | package="google-glog_$VERSION" 48 | 49 | # Debian has very specific requirements about the naming of build 50 | # directories, and tar archives. It also wants to write all generated 51 | # packages to the parent of the source directory. We accommodate these 52 | # requirements by building directly from the tar file. 53 | ln -s "${topdir}/${archive}.tar.gz" "${LIB}${package}.orig.tar.gz" 54 | tar zfx "${LIB}${package}.orig.tar.gz" 55 | mv "${archive}" "${LIB}${package}" 56 | cd "${LIB}${package}" 57 | # This is one of those 'specific requirements': where the deb control files live 58 | cp -a "packages/deb" "debian" 59 | 60 | # Now, we can call Debian's standard build tool 61 | debuild -uc -us 62 | cd ../.. # get back to the original top-level dir 63 | 64 | # We'll put the result in a subdirectory that's named after the OS version 65 | # we've made this .deb file for. 66 | destdir="debian-$(cat /etc/debian_version 2>/dev/null || echo UNKNOWN)" 67 | 68 | rm -rf "$destdir" 69 | mkdir -p "$destdir" 70 | mv $(find tmp -mindepth 1 -maxdepth 1 -type f) "$destdir" 71 | 72 | echo 73 | echo "The Debian package files are located in $PWD/$destdir" 74 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/README: -------------------------------------------------------------------------------- 1 | The list of files here isn't complete. For a step-by-step guide on 2 | how to set this package up correctly, check out 3 | http://www.debian.org/doc/maint-guide/ 4 | 5 | Most of the files that are in this directory are boilerplate. 6 | However, you may need to change the list of binary-arch dependencies 7 | in 'rules'. 8 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/changelog: -------------------------------------------------------------------------------- 1 | google-glog (0.3.4-1) unstable; urgency=low 2 | 3 | * New upstream release. 4 | 5 | -- Google Inc. Tue, 10 Mar 2015 12:02:20 +0900 6 | 7 | google-glog (0.3.3-1) unstable; urgency=low 8 | 9 | * New upstream release. 10 | 11 | -- Google Inc. Fri, 01 Feb 2012 14:54:14 +0900 12 | 13 | google-glog (0.3.2-1) unstable; urgency=low 14 | 15 | * New upstream release. 16 | 17 | -- Google Inc. Thu, 12 Jan 2012 17:36:14 +0900 18 | 19 | google-glog (0.3.1-1) unstable; urgency=low 20 | 21 | * New upstream release. 22 | 23 | -- Google Inc. Tue, 15 Jun 2010 13:50:47 +0900 24 | 25 | google-glog (0.3-1) unstable; urgency=low 26 | 27 | * New upstream release. 28 | 29 | -- Google Inc. Thu, 30 Jul 2009 21:31:35 +0900 30 | 31 | google-glog (0.2.1-1) unstable; urgency=low 32 | 33 | * New upstream release. 34 | 35 | -- Google Inc. Fri, 10 Apr 2009 15:24:17 +0900 36 | 37 | google-glog (0.2-1) unstable; urgency=low 38 | 39 | * New upstream release. 40 | 41 | -- Google Inc. Fri, 23 Jan 2009 03:14:29 +0900 42 | 43 | google-glog (0.1.2-1) unstable; urgency=low 44 | 45 | * New upstream release. 46 | 47 | -- Google Inc. Tue, 18 Nov 2008 20:37:00 +0900 48 | 49 | google-glog (0.1.1-1) unstable; urgency=low 50 | 51 | * New upstream release. 52 | 53 | -- Google Inc. Wed, 15 Oct 2008 20:38:19 +0900 54 | 55 | google-glog (0.1-1) unstable; urgency=low 56 | 57 | * Initial release. 58 | 59 | -- Google Inc. Sat, 10 May 2008 12:31:10 +0900 60 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/compat: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/control: -------------------------------------------------------------------------------- 1 | Source: google-glog 2 | Priority: optional 3 | Maintainer: Google Inc. 4 | Build-Depends: debhelper (>= 4.0.0), binutils 5 | Standards-Version: 3.6.1 6 | 7 | Package: libgoogle-glog-dev 8 | Section: libdevel 9 | Architecture: any 10 | Depends: libgoogle-glog0 (= ${Source-Version}) 11 | Description: a library that implements application-level logging. 12 | This library provides logging APIs based on C++-style streams and 13 | various helper macros. The devel package contains static and debug 14 | libraries and header files for developing applications that use the 15 | google-glog package. 16 | 17 | Package: libgoogle-glog0 18 | Section: libs 19 | Architecture: any 20 | Depends: ${shlibs:Depends} 21 | Description: a library that implements application-level logging. 22 | This library provides logging APIs based on C++-style streams and 23 | various helper macros. 24 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Google Inc. on 2 | 13 June 2008. 3 | 4 | It was downloaded from https://github.com/google/glog 5 | 6 | Upstream Author: opensource@google.com 7 | 8 | Copyright (c) 2008, Google Inc. 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are 13 | met: 14 | 15 | * Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the following disclaimer 19 | in the documentation and/or other materials provided with the 20 | distribution. 21 | * Neither the name of Google Inc. nor the names of its 22 | contributors may be used to endorse or promote products derived from 23 | this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/docs: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | COPYING 3 | ChangeLog 4 | INSTALL 5 | NEWS 6 | README 7 | doc/designstyle.css 8 | doc/glog.html 9 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/libgoogle-glog-dev.dirs: -------------------------------------------------------------------------------- 1 | usr/lib 2 | usr/lib/pkgconfig 3 | usr/include 4 | usr/include/glog 5 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/libgoogle-glog-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/glog/* 2 | usr/lib/lib*.so 3 | usr/lib/lib*.a 4 | usr/lib/*.la 5 | usr/lib/pkgconfig/* 6 | debian/tmp/usr/include/glog/* 7 | debian/tmp/usr/lib/lib*.so 8 | debian/tmp/usr/lib/lib*.a 9 | debian/tmp/usr/lib/*.la 10 | debian/tmp/usr/lib/pkgconfig/* 11 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/libgoogle-glog0.dirs: -------------------------------------------------------------------------------- 1 | usr/lib 2 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/libgoogle-glog0.install: -------------------------------------------------------------------------------- 1 | usr/lib/lib*.so.* 2 | debian/tmp/usr/lib/lib*.so.* 3 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/deb/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | 13 | # These are used for cross-compiling and for saving the configure script 14 | # from having to guess our platform (since we know it already) 15 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) 16 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 17 | 18 | 19 | CFLAGS = -Wall -g 20 | 21 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) 22 | CFLAGS += -O0 23 | else 24 | CFLAGS += -O2 25 | endif 26 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) 27 | INSTALL_PROGRAM += -s 28 | endif 29 | 30 | # shared library versions, option 1 31 | #version=2.0.5 32 | #major=2 33 | # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so 34 | version=`ls src/.libs/lib*.so.* | \ 35 | awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` 36 | major=`ls src/.libs/lib*.so.* | \ 37 | awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` 38 | 39 | config.status: configure 40 | dh_testdir 41 | # Add here commands to configure the package. 42 | CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info 43 | 44 | 45 | build: build-stamp 46 | build-stamp: config.status 47 | dh_testdir 48 | 49 | # Add here commands to compile the package. 50 | $(MAKE) 51 | 52 | touch build-stamp 53 | 54 | clean: 55 | dh_testdir 56 | dh_testroot 57 | rm -f build-stamp 58 | 59 | # Add here commands to clean up after the build process. 60 | -$(MAKE) distclean 61 | ifneq "$(wildcard /usr/share/misc/config.sub)" "" 62 | cp -f /usr/share/misc/config.sub config.sub 63 | endif 64 | ifneq "$(wildcard /usr/share/misc/config.guess)" "" 65 | cp -f /usr/share/misc/config.guess config.guess 66 | endif 67 | 68 | 69 | dh_clean 70 | 71 | install: build 72 | dh_testdir 73 | dh_testroot 74 | dh_clean -k 75 | dh_installdirs 76 | 77 | # Add here commands to install the package into debian/tmp 78 | $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp 79 | 80 | 81 | # Build architecture-independent files here. 82 | binary-indep: build install 83 | # We have nothing to do by default. 84 | 85 | # Build architecture-dependent files here. 86 | binary-arch: build install 87 | dh_testdir 88 | dh_testroot 89 | dh_installchangelogs ChangeLog 90 | dh_installdocs 91 | dh_installexamples 92 | dh_install --sourcedir=debian/tmp 93 | # dh_installmenu 94 | # dh_installdebconf 95 | # dh_installlogrotate 96 | # dh_installemacsen 97 | # dh_installpam 98 | # dh_installmime 99 | # dh_installinit 100 | # dh_installcron 101 | # dh_installinfo 102 | dh_installman 103 | dh_link 104 | dh_strip 105 | dh_compress 106 | dh_fixperms 107 | # dh_perl 108 | # dh_python 109 | dh_makeshlibs 110 | dh_installdeb 111 | dh_shlibdeps 112 | dh_gencontrol 113 | dh_md5sums 114 | dh_builddeb 115 | 116 | binary: binary-indep binary-arch 117 | .PHONY: build clean binary-indep binary-arch binary install 118 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/rpm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # Run this from the 'packages' directory, just under rootdir 4 | 5 | # We can only build rpm packages, if the rpm build tools are installed 6 | if [ \! -x /usr/bin/rpmbuild ] 7 | then 8 | echo "Cannot find /usr/bin/rpmbuild. Not building an rpm." 1>&2 9 | exit 0 10 | fi 11 | 12 | # Check the commandline flags 13 | PACKAGE="$1" 14 | VERSION="$2" 15 | fullname="${PACKAGE}-${VERSION}" 16 | archive=../$fullname.tar.gz 17 | 18 | if [ -z "$1" -o -z "$2" ] 19 | then 20 | echo "Usage: $0 " 1>&2 21 | exit 0 22 | fi 23 | 24 | # Double-check we're in the packages directory, just under rootdir 25 | if [ \! -r ../Makefile -a \! -r ../INSTALL ] 26 | then 27 | echo "Must run $0 in the 'packages' directory, under the root directory." 1>&2 28 | echo "Also, you must run \"make dist\" before running this script." 1>&2 29 | exit 0 30 | fi 31 | 32 | if [ \! -r "$archive" ] 33 | then 34 | echo "Cannot find $archive. Run \"make dist\" first." 1>&2 35 | exit 0 36 | fi 37 | 38 | # Create the directory where the input lives, and where the output should live 39 | RPM_SOURCE_DIR="/tmp/rpmsource-$fullname" 40 | RPM_BUILD_DIR="/tmp/rpmbuild-$fullname" 41 | 42 | trap 'rm -rf $RPM_SOURCE_DIR $RPM_BUILD_DIR; exit $?' EXIT SIGHUP SIGINT SIGTERM 43 | 44 | rm -rf "$RPM_SOURCE_DIR" "$RPM_BUILD_DIR" 45 | mkdir "$RPM_SOURCE_DIR" 46 | mkdir "$RPM_BUILD_DIR" 47 | 48 | cp "$archive" "$RPM_SOURCE_DIR"/v"$VERSION".tar.gz 49 | 50 | rpmbuild -bb rpm/rpm.spec \ 51 | --define "NAME $PACKAGE" \ 52 | --define "VERSION $VERSION" \ 53 | --define "_sourcedir $RPM_SOURCE_DIR" \ 54 | --define "_builddir $RPM_BUILD_DIR" \ 55 | --define "_rpmdir $RPM_SOURCE_DIR" 56 | 57 | # We put the output in a directory based on what system we've built for 58 | destdir=rpm-unknown 59 | if [ -r /etc/issue ] 60 | then 61 | grep "Red Hat.*release 7" /etc/issue >/dev/null 2>&1 && destdir=rh7 62 | grep "Red Hat.*release 8" /etc/issue >/dev/null 2>&1 && destdir=rh8 63 | grep "Red Hat.*release 9" /etc/issue >/dev/null 2>&1 && destdir=rh9 64 | if grep Fedora /etc/issue >/dev/null; then 65 | destdir=fc`grep Fedora /etc/issue | cut -d' ' -f 4`; 66 | fi 67 | fi 68 | 69 | rm -rf "$destdir" 70 | mkdir -p "$destdir" 71 | # We want to get not only the main package but devel etc, hence the middle * 72 | mv "$RPM_SOURCE_DIR"/*/"${PACKAGE}"-*"${VERSION}"*.rpm "$destdir" 73 | 74 | echo 75 | echo "The rpm package file(s) are located in $PWD/$destdir" 76 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/packages/rpm/rpm.spec: -------------------------------------------------------------------------------- 1 | %define RELEASE 1 2 | %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} 3 | %define prefix /usr 4 | 5 | Name: %NAME 6 | Summary: A C++ application logging library 7 | Version: %VERSION 8 | Release: %rel 9 | Group: Development/Libraries 10 | URL: http://github.com/google/glog 11 | License: BSD 12 | Vendor: Google 13 | Packager: Google Inc. 14 | Source: https://github.com/google/glog/archive/v%{VERSION}.tar.gz 15 | Distribution: Redhat 7 and above. 16 | Buildroot: %{_tmppath}/%{name}-root 17 | Prefix: %prefix 18 | 19 | %description 20 | The %name package contains a library that implements application-level 21 | logging. This library provides logging APIs based on C++-style 22 | streams and various helper macros. 23 | 24 | %package devel 25 | Summary: A C++ application logging library 26 | Group: Development/Libraries 27 | Requires: %{NAME} = %{VERSION} 28 | 29 | %description devel 30 | The %name-devel package contains static and debug libraries and header 31 | files for developing applications that use the %name package. 32 | 33 | %changelog 34 | * Wed Mar 26 2008 35 | - First draft 36 | 37 | %prep 38 | %setup 39 | 40 | %build 41 | ./configure 42 | make prefix=%prefix 43 | 44 | %install 45 | rm -rf $RPM_BUILD_ROOT 46 | make prefix=$RPM_BUILD_ROOT%{prefix} install 47 | 48 | %clean 49 | rm -rf $RPM_BUILD_ROOT 50 | 51 | %files 52 | %defattr(-,root,root) 53 | 54 | ## Mark all installed files within /usr/share/doc/{package name} as 55 | ## documentation. This depends on the following two lines appearing in 56 | ## Makefile.am: 57 | ## docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION) 58 | ## dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README 59 | %docdir %{prefix}/share/doc/%{NAME}-%{VERSION} 60 | %{prefix}/share/doc/%{NAME}-%{VERSION}/* 61 | 62 | %{prefix}/lib/libglog.so.0 63 | %{prefix}/lib/libglog.so.0.0.0 64 | 65 | %files devel 66 | %defattr(-,root,root) 67 | 68 | %{prefix}/include/glog 69 | %{prefix}/lib/libglog.a 70 | %{prefix}/lib/libglog.la 71 | %{prefix}/lib/libglog.so 72 | %{prefix}/lib/pkgconfig/libglog.pc 73 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/base/googleinit.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // --- 31 | // Author: Jacob Hoffman-Andrews 32 | 33 | #ifndef _GOOGLEINIT_H 34 | #define _GOOGLEINIT_H 35 | 36 | class GoogleInitializer { 37 | public: 38 | typedef void (*void_function)(void); 39 | GoogleInitializer(const char*, void_function f) { 40 | f(); 41 | } 42 | }; 43 | 44 | #define REGISTER_MODULE_INITIALIZER(name, body) \ 45 | namespace { \ 46 | static void google_init_module_##name () { body; } \ 47 | GoogleInitializer google_initializer_module_##name(#name, \ 48 | google_init_module_##name); \ 49 | } 50 | 51 | #endif /* _GOOGLEINIT_H */ 52 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/config_for_unittests.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // --- 31 | // All Rights Reserved. 32 | // 33 | // Author: Craig Silverstein 34 | // Copied from google-perftools and modified by Shinichiro Hamaji 35 | // 36 | // This file is needed for windows -- unittests are not part of the 37 | // glog dll, but still want to include config.h just like the 38 | // dll does, so they can use internal tools and APIs for testing. 39 | // 40 | // The problem is that config.h declares GOOGLE_GLOG_DLL_DECL to be 41 | // for exporting symbols, but the unittest needs to *import* symbols 42 | // (since it's not the dll). 43 | // 44 | // The solution is to have this file, which is just like config.h but 45 | // sets GOOGLE_GLOG_DLL_DECL to do a dllimport instead of a dllexport. 46 | // 47 | // The reason we need this extra GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS 48 | // variable is in case people want to set GOOGLE_GLOG_DLL_DECL explicitly 49 | // to something other than __declspec(dllexport). In that case, they 50 | // may want to use something other than __declspec(dllimport) for the 51 | // unittest case. For that, we allow folks to define both 52 | // GOOGLE_GLOG_DLL_DECL and GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS explicitly. 53 | // 54 | // NOTE: This file is equivalent to config.h on non-windows systems, 55 | // which never defined GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS and always 56 | // define GOOGLE_GLOG_DLL_DECL to the empty string. 57 | 58 | #include "config.h" 59 | 60 | #undef GOOGLE_GLOG_DLL_DECL 61 | #ifdef GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS 62 | # define GOOGLE_GLOG_DLL_DECL GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS 63 | #else 64 | // if DLL_DECL_FOR_UNITTESTS isn't defined, use "" 65 | # define GOOGLE_GLOG_DLL_DECL 66 | #endif 67 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/demangle.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Satoru Takabayashi 31 | // 32 | // An async-signal-safe and thread-safe demangler for Itanium C++ ABI 33 | // (aka G++ V3 ABI). 34 | 35 | // The demangler is implemented to be used in async signal handlers to 36 | // symbolize stack traces. We cannot use libstdc++'s 37 | // abi::__cxa_demangle() in such signal handlers since it's not async 38 | // signal safe (it uses malloc() internally). 39 | // 40 | // Note that this demangler doesn't support full demangling. More 41 | // specifically, it doesn't print types of function parameters and 42 | // types of template arguments. It just skips them. However, it's 43 | // still very useful to extract basic information such as class, 44 | // function, constructor, destructor, and operator names. 45 | // 46 | // See the implementation note in demangle.cc if you are interested. 47 | // 48 | // Example: 49 | // 50 | // | Mangled Name | The Demangler | abi::__cxa_demangle() 51 | // |---------------|---------------|----------------------- 52 | // | _Z1fv | f() | f() 53 | // | _Z1fi | f() | f(int) 54 | // | _Z3foo3bar | foo() | foo(bar) 55 | // | _Z1fIiEvi | f<>() | void f(int) 56 | // | _ZN1N1fE | N::f | N::f 57 | // | _ZN3Foo3BarEv | Foo::Bar() | Foo::Bar() 58 | // | _Zrm1XS_" | operator%() | operator%(X, X) 59 | // | _ZN3FooC1Ev | Foo::Foo() | Foo::Foo() 60 | // | _Z1fSs | f() | f(std::basic_string, 62 | // | | | std::allocator >) 63 | // 64 | // See the unit test for more examples. 65 | // 66 | // Note: we might want to write demanglers for ABIs other than Itanium 67 | // C++ ABI in the future. 68 | // 69 | 70 | #ifndef BASE_DEMANGLE_H_ 71 | #define BASE_DEMANGLE_H_ 72 | 73 | #include "config.h" 74 | 75 | _START_GOOGLE_NAMESPACE_ 76 | 77 | // Demangle "mangled". On success, return true and write the 78 | // demangled symbol name to "out". Otherwise, return false. 79 | // "out" is modified even if demangling is unsuccessful. 80 | bool GOOGLE_GLOG_DLL_DECL Demangle(const char *mangled, char *out, int out_size); 81 | 82 | _END_GOOGLE_NAMESPACE_ 83 | 84 | #endif // BASE_DEMANGLE_H_ 85 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/demangle_unittest.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # Copyright (c) 2006, Google Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | # 32 | # Author: Satoru Takabayashi 33 | # 34 | # Unit tests for demangle.c with a real binary. 35 | 36 | set -e 37 | 38 | die () { 39 | echo $1 40 | exit 1 41 | } 42 | 43 | BINDIR=".libs" 44 | LIBGLOG="$BINDIR/libglog.so" 45 | 46 | DEMANGLER="$BINDIR/demangle_unittest" 47 | 48 | if test -e "$DEMANGLER"; then 49 | # We need shared object. 50 | export LD_LIBRARY_PATH=$BINDIR 51 | export DYLD_LIBRARY_PATH=$BINDIR 52 | else 53 | # For windows 54 | DEMANGLER="./demangle_unittest.exe" 55 | if ! test -e "$DEMANGLER"; then 56 | echo "We coundn't find demangle_unittest binary." 57 | exit 1 58 | fi 59 | fi 60 | 61 | # Extract C++ mangled symbols from libbase.so. 62 | NM_OUTPUT="demangle.nm" 63 | nm "$LIBGLOG" | perl -nle 'print $1 if /\s(_Z\S+$)/' > "$NM_OUTPUT" 64 | 65 | # Check if mangled symbols exist. If there are none, we quit. 66 | # The binary is more likely compiled with GCC 2.95 or something old. 67 | if ! grep --quiet '^_Z' "$NM_OUTPUT"; then 68 | echo "PASS" 69 | exit 0 70 | fi 71 | 72 | # Demangle the symbols using our demangler. 73 | DM_OUTPUT="demangle.dm" 74 | GLOG_demangle_filter=1 "$DEMANGLER" --demangle_filter < "$NM_OUTPUT" > "$DM_OUTPUT" 75 | 76 | # Calculate the numbers of lines. 77 | NM_LINES=`wc -l "$NM_OUTPUT" | awk '{ print $1 }'` 78 | DM_LINES=`wc -l "$DM_OUTPUT" | awk '{ print $1 }'` 79 | 80 | # Compare the numbers of lines. They must be the same. 81 | if test "$NM_LINES" != "$DM_LINES"; then 82 | die "$NM_OUTPUT and $DM_OUTPUT don't have the same numbers of lines" 83 | fi 84 | 85 | # Check if mangled symbols exist. They must not exist. 86 | if grep --quiet '^_Z' "$DM_OUTPUT"; then 87 | MANGLED=`grep '^_Z' "$DM_OUTPUT" | wc -l | awk '{ print \$1 }'` 88 | echo "Mangled symbols ($MANGLED out of $NM_LINES) found in $DM_OUTPUT:" 89 | grep '^_Z' "$DM_OUTPUT" 90 | die "Mangled symbols ($MANGLED out of $NM_LINES) found in $DM_OUTPUT" 91 | fi 92 | 93 | # All C++ symbols are demangled successfully. 94 | echo "PASS" 95 | exit 0 96 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/glog/log_severity.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #ifndef BASE_LOG_SEVERITY_H__ 31 | #define BASE_LOG_SEVERITY_H__ 32 | 33 | // Annoying stuff for windows -- makes sure clients can import these functions 34 | #ifndef GOOGLE_GLOG_DLL_DECL 35 | # if defined(_WIN32) && !defined(__CYGWIN__) 36 | # define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) 37 | # else 38 | # define GOOGLE_GLOG_DLL_DECL 39 | # endif 40 | #endif 41 | 42 | // Variables of type LogSeverity are widely taken to lie in the range 43 | // [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if 44 | // you ever need to change their values or add a new severity. 45 | typedef int LogSeverity; 46 | 47 | const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3, 48 | NUM_SEVERITIES = 4; 49 | #ifndef GLOG_NO_ABBREVIATED_SEVERITIES 50 | # ifdef ERROR 51 | # error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail. 52 | # endif 53 | const int INFO = GLOG_INFO, WARNING = GLOG_WARNING, 54 | ERROR = GLOG_ERROR, FATAL = GLOG_FATAL; 55 | #endif 56 | 57 | // DFATAL is FATAL in debug mode, ERROR in normal mode 58 | #ifdef NDEBUG 59 | #define DFATAL_LEVEL ERROR 60 | #else 61 | #define DFATAL_LEVEL FATAL 62 | #endif 63 | 64 | extern GOOGLE_GLOG_DLL_DECL const char* const LogSeverityNames[NUM_SEVERITIES]; 65 | 66 | // NDEBUG usage helpers related to (RAW_)DCHECK: 67 | // 68 | // DEBUG_MODE is for small !NDEBUG uses like 69 | // if (DEBUG_MODE) foo.CheckThatFoo(); 70 | // instead of substantially more verbose 71 | // #ifndef NDEBUG 72 | // foo.CheckThatFoo(); 73 | // #endif 74 | // 75 | // IF_DEBUG_MODE is for small !NDEBUG uses like 76 | // IF_DEBUG_MODE( string error; ) 77 | // DCHECK(Foo(&error)) << error; 78 | // instead of substantially more verbose 79 | // #ifndef NDEBUG 80 | // string error; 81 | // DCHECK(Foo(&error)) << error; 82 | // #endif 83 | // 84 | #ifdef NDEBUG 85 | enum { DEBUG_MODE = 0 }; 86 | #define IF_DEBUG_MODE(x) 87 | #else 88 | enum { DEBUG_MODE = 1 }; 89 | #define IF_DEBUG_MODE(x) x 90 | #endif 91 | 92 | #endif // BASE_LOG_SEVERITY_H__ 93 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/logging_striplog_test.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # Copyright (c) 2007, Google Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | # 32 | # Author: Sergey Ioffe 33 | 34 | get_strings () { 35 | if test -e ".libs/$1"; then 36 | binary=".libs/$1" 37 | elif test -e "$1.exe"; then 38 | binary="$1.exe" 39 | else 40 | echo "We coundn't find $1 binary." 41 | exit 1 42 | fi 43 | 44 | strings -n 10 $binary | sort | awk '/TESTMESSAGE/ {printf "%s ", $2}' 45 | } 46 | 47 | # Die if "$1" != "$2", print $3 as death reason 48 | check_eq () { 49 | if [ "$1" != "$2" ]; then 50 | echo "Check failed: '$1' == '$2' ${3:+ ($3)}" 51 | exit 1 52 | fi 53 | } 54 | 55 | die () { 56 | echo $1 57 | exit 1 58 | } 59 | 60 | # Check that the string literals are appropriately stripped. This will 61 | # not be the case in debug mode. 62 | 63 | mode=`GLOG_check_mode=1 ./logging_striptest0 2> /dev/null` 64 | if [ "$mode" = "opt" ]; 65 | then 66 | echo "In OPT mode" 67 | check_eq "`get_strings logging_striptest0`" "COND ERROR FATAL INFO USAGE WARNING " 68 | check_eq "`get_strings logging_striptest2`" "COND ERROR FATAL USAGE " 69 | check_eq "`get_strings logging_striptest10`" "" 70 | else 71 | echo "In DBG mode; not checking strings" 72 | fi 73 | 74 | # Check that LOG(FATAL) aborts even for large STRIP_LOG 75 | 76 | ./logging_striptest2 2>/dev/null && die "Did not abort for STRIP_LOG=2" 77 | ./logging_striptest10 2>/dev/null && die "Did not abort for STRIP_LOG=10" 78 | 79 | echo "PASS" 80 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/logging_striptest10.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Sergey Ioffe 31 | 32 | #define GOOGLE_STRIP_LOG 10 33 | 34 | // Include the actual test. 35 | #include "logging_striptest_main.cc" 36 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/logging_striptest2.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Sergey Ioffe 31 | 32 | #define GOOGLE_STRIP_LOG 2 33 | 34 | // Include the actual test. 35 | #include "logging_striptest_main.cc" 36 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/logging_striptest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Sergey Ioffe 31 | 32 | // The common part of the striplog tests. 33 | 34 | #include 35 | #include 36 | #include 37 | #include "glog/logging.h" 38 | #include "base/commandlineflags.h" 39 | #include "config.h" 40 | 41 | DECLARE_bool(logtostderr); 42 | GLOG_DEFINE_bool(check_mode, false, "Prints 'opt' or 'dbg'"); 43 | 44 | using std::string; 45 | using namespace GOOGLE_NAMESPACE; 46 | 47 | int CheckNoReturn(bool b) { 48 | string s; 49 | if (b) { 50 | LOG(FATAL) << "Fatal"; 51 | } else { 52 | return 0; 53 | } 54 | } 55 | 56 | struct A { }; 57 | std::ostream &operator<<(std::ostream &str, const A&) {return str;} 58 | 59 | int main(int, char* argv[]) { 60 | FLAGS_logtostderr = true; 61 | InitGoogleLogging(argv[0]); 62 | if (FLAGS_check_mode) { 63 | printf("%s\n", DEBUG_MODE ? "dbg" : "opt"); 64 | return 0; 65 | } 66 | LOG(INFO) << "TESTMESSAGE INFO"; 67 | LOG(WARNING) << 2 << "something" << "TESTMESSAGE WARNING" 68 | << 1 << 'c' << A() << std::endl; 69 | LOG(ERROR) << "TESTMESSAGE ERROR"; 70 | bool flag = true; 71 | (flag ? LOG(INFO) : LOG(ERROR)) << "TESTMESSAGE COND"; 72 | LOG(FATAL) << "TESTMESSAGE FATAL"; 73 | } 74 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/mock-log_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Zhanyong Wan 31 | 32 | // Tests the ScopedMockLog class. 33 | 34 | #include "mock-log.h" 35 | 36 | #include 37 | 38 | #include 39 | #include 40 | 41 | namespace { 42 | 43 | using GOOGLE_NAMESPACE::INFO; 44 | using GOOGLE_NAMESPACE::WARNING; 45 | using GOOGLE_NAMESPACE::ERROR; 46 | using GOOGLE_NAMESPACE::glog_testing::ScopedMockLog; 47 | using std::string; 48 | using testing::_; 49 | using testing::HasSubstr; 50 | using testing::InSequence; 51 | using testing::InvokeWithoutArgs; 52 | 53 | // Tests that ScopedMockLog intercepts LOG()s when it's alive. 54 | TEST(ScopedMockLogTest, InterceptsLog) { 55 | ScopedMockLog log; 56 | 57 | InSequence s; 58 | EXPECT_CALL(log, Log(WARNING, HasSubstr("/mock-log_test.cc"), "Fishy.")); 59 | EXPECT_CALL(log, Log(INFO, _, "Working...")) 60 | .Times(2); 61 | EXPECT_CALL(log, Log(ERROR, _, "Bad!!")); 62 | 63 | LOG(WARNING) << "Fishy."; 64 | LOG(INFO) << "Working..."; 65 | LOG(INFO) << "Working..."; 66 | LOG(ERROR) << "Bad!!"; 67 | } 68 | 69 | void LogBranch() { 70 | LOG(INFO) << "Logging a branch..."; 71 | } 72 | 73 | void LogTree() { 74 | LOG(INFO) << "Logging the whole tree..."; 75 | } 76 | 77 | void LogForest() { 78 | LOG(INFO) << "Logging the entire forest."; 79 | LOG(INFO) << "Logging the entire forest.."; 80 | LOG(INFO) << "Logging the entire forest..."; 81 | } 82 | 83 | // The purpose of the following test is to verify that intercepting logging 84 | // continues to work properly if a LOG statement is executed within the scope 85 | // of a mocked call. 86 | TEST(ScopedMockLogTest, LogDuringIntercept) { 87 | ScopedMockLog log; 88 | InSequence s; 89 | EXPECT_CALL(log, Log(INFO, __FILE__, "Logging a branch...")) 90 | .WillOnce(InvokeWithoutArgs(LogTree)); 91 | EXPECT_CALL(log, Log(INFO, __FILE__, "Logging the whole tree...")) 92 | .WillOnce(InvokeWithoutArgs(LogForest)); 93 | EXPECT_CALL(log, Log(INFO, __FILE__, "Logging the entire forest.")); 94 | EXPECT_CALL(log, Log(INFO, __FILE__, "Logging the entire forest..")); 95 | EXPECT_CALL(log, Log(INFO, __FILE__, "Logging the entire forest...")); 96 | LogBranch(); 97 | } 98 | 99 | } // namespace 100 | 101 | int main(int argc, char **argv) { 102 | GOOGLE_NAMESPACE::InitGoogleLogging(argv[0]); 103 | testing::InitGoogleMock(&argc, argv); 104 | 105 | return RUN_ALL_TESTS(); 106 | } 107 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/signalhandler_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Satoru Takabayashi 31 | // 32 | // This is a helper binary for testing signalhandler.cc. The actual test 33 | // is done in signalhandler_unittest.sh. 34 | 35 | #include "utilities.h" 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include "glog/logging.h" 43 | 44 | #ifdef HAVE_LIB_GFLAGS 45 | #include 46 | using namespace gflags; 47 | #endif 48 | 49 | using namespace GOOGLE_NAMESPACE; 50 | 51 | void* DieInThread(void*) { 52 | // We assume pthread_t is an integral number or a pointer, rather 53 | // than a complex struct. In some environments, pthread_self() 54 | // returns an uint64 but in some other environments pthread_self() 55 | // returns a pointer. Hence we use C-style cast here, rather than 56 | // reinterpret/static_cast, to support both types of environments. 57 | fprintf(stderr, "0x%lx is dying\n", (long)pthread_self()); 58 | // Use volatile to prevent from these to be optimized away. 59 | volatile int a = 0; 60 | volatile int b = 1 / a; 61 | fprintf(stderr, "We should have died: b=%d\n", b); 62 | return NULL; 63 | } 64 | 65 | void WriteToStdout(const char* data, int size) { 66 | if (write(STDOUT_FILENO, data, size) < 0) { 67 | // Ignore errors. 68 | } 69 | } 70 | 71 | int main(int argc, char **argv) { 72 | #if defined(HAVE_STACKTRACE) && defined(HAVE_SYMBOLIZE) 73 | InitGoogleLogging(argv[0]); 74 | #ifdef HAVE_LIB_GFLAGS 75 | ParseCommandLineFlags(&argc, &argv, true); 76 | #endif 77 | InstallFailureSignalHandler(); 78 | const std::string command = argc > 1 ? argv[1] : "none"; 79 | if (command == "segv") { 80 | // We'll check if this is outputted. 81 | LOG(INFO) << "create the log file"; 82 | LOG(INFO) << "a message before segv"; 83 | // We assume 0xDEAD is not writable. 84 | int *a = (int*)0xDEAD; 85 | *a = 0; 86 | } else if (command == "loop") { 87 | fprintf(stderr, "looping\n"); 88 | while (true); 89 | } else if (command == "die_in_thread") { 90 | pthread_t thread; 91 | pthread_create(&thread, NULL, &DieInThread, NULL); 92 | pthread_join(thread, NULL); 93 | } else if (command == "dump_to_stdout") { 94 | InstallFailureWriter(WriteToStdout); 95 | abort(); 96 | } else { 97 | // Tell the shell script 98 | puts("OK"); 99 | } 100 | #endif 101 | return 0; 102 | } 103 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/signalhandler_unittest.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # Copyright (c) 2008, Google Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | # 32 | # Author: Satoru Takabayashi 33 | # 34 | # Unit tests for signalhandler.cc. 35 | 36 | die () { 37 | echo $1 38 | exit 1 39 | } 40 | 41 | BINDIR=".libs" 42 | LIBGLOG="$BINDIR/libglog.so" 43 | 44 | BINARY="$BINDIR/signalhandler_unittest" 45 | LOG_INFO="./signalhandler_unittest.INFO" 46 | 47 | # Remove temporary files. 48 | rm -f signalhandler.out* 49 | 50 | if test -e "$BINARY"; then 51 | # We need shared object. 52 | export LD_LIBRARY_PATH=$BINDIR 53 | export DYLD_LIBRARY_PATH=$BINDIR 54 | else 55 | # For windows 56 | BINARY="./signalhandler_unittest.exe" 57 | if ! test -e "$BINARY"; then 58 | echo "We coundn't find demangle_unittest binary." 59 | exit 1 60 | fi 61 | fi 62 | 63 | if [ x`$BINARY` != 'xOK' ]; then 64 | echo "PASS (No stacktrace support. We don't run this test.)" 65 | exit 0 66 | fi 67 | 68 | # The PC cannot be obtained in signal handlers on PowerPC correctly. 69 | # We just skip the test for PowerPC. 70 | if [ x`uname -p` = x"powerpc" ]; then 71 | echo "PASS (We don't test the signal handler on PowerPC.)" 72 | exit 0 73 | fi 74 | 75 | # Test for a case the program kills itself by SIGSEGV. 76 | GOOGLE_LOG_DIR=. $BINARY segv 2> signalhandler.out1 77 | for pattern in SIGSEGV 0xdead main "Aborted at [0-9]"; do 78 | if ! grep --quiet "$pattern" signalhandler.out1; then 79 | die "'$pattern' should appear in the output" 80 | fi 81 | done 82 | if ! grep --quiet "a message before segv" $LOG_INFO; then 83 | die "'a message before segv' should appear in the INFO log" 84 | fi 85 | rm -f $LOG_INFO 86 | 87 | # Test for a case the program is killed by this shell script. 88 | # $! = the process id of the last command run in the background. 89 | # $$ = the process id of this shell. 90 | $BINARY loop 2> signalhandler.out2 & 91 | # Wait until "looping" is written in the file. This indicates the program 92 | # is ready to accept signals. 93 | while true; do 94 | if grep --quiet looping signalhandler.out2; then 95 | break 96 | fi 97 | done 98 | kill -TERM $! 99 | wait $! 100 | 101 | from_pid='' 102 | # Only linux has the process ID of the signal sender. 103 | if [ x`uname` = "xLinux" ]; then 104 | from_pid="from PID $$" 105 | fi 106 | for pattern in SIGTERM "by PID $!" "$from_pid" main "Aborted at [0-9]"; do 107 | if ! grep --quiet "$pattern" signalhandler.out2; then 108 | die "'$pattern' should appear in the output" 109 | fi 110 | done 111 | 112 | # Test for a case the program dies in a non-main thread. 113 | $BINARY die_in_thread 2> signalhandler.out3 114 | EXPECTED_TID="`sed 's/ .*//; q' signalhandler.out3`" 115 | 116 | for pattern in SIGFPE DieInThread "TID $EXPECTED_TID" "Aborted at [0-9]"; do 117 | if ! grep --quiet "$pattern" signalhandler.out3; then 118 | die "'$pattern' should appear in the output" 119 | fi 120 | done 121 | 122 | # Test for a case the program installs a custom failure writer that writes 123 | # stuff to stdout instead of stderr. 124 | $BINARY dump_to_stdout 1> signalhandler.out4 125 | for pattern in SIGABRT main "Aborted at [0-9]"; do 126 | if ! grep --quiet "$pattern" signalhandler.out4; then 127 | die "'$pattern' should appear in the output" 128 | fi 129 | done 130 | 131 | echo PASS 132 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/stacktrace.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2000 - 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Routines to extract the current stack trace. These functions are 31 | // thread-safe. 32 | 33 | #ifndef BASE_STACKTRACE_H_ 34 | #define BASE_STACKTRACE_H_ 35 | 36 | #include "config.h" 37 | 38 | _START_GOOGLE_NAMESPACE_ 39 | 40 | // This is similar to the GetStackFrames routine, except that it returns 41 | // the stack trace only, and not the stack frame sizes as well. 42 | // Example: 43 | // main() { foo(); } 44 | // foo() { bar(); } 45 | // bar() { 46 | // void* result[10]; 47 | // int depth = GetStackFrames(result, 10, 1); 48 | // } 49 | // 50 | // This produces: 51 | // result[0] foo 52 | // result[1] main 53 | // .... ... 54 | // 55 | // "result" must not be NULL. 56 | extern int GetStackTrace(void** result, int max_depth, int skip_count); 57 | 58 | _END_GOOGLE_NAMESPACE_ 59 | 60 | #endif // BASE_STACKTRACE_H_ 61 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/stacktrace_generic-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2000 - 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Portable implementation - just use glibc 31 | // 32 | // Note: The glibc implementation may cause a call to malloc. 33 | // This can cause a deadlock in HeapProfiler. 34 | #include 35 | #include 36 | #include "stacktrace.h" 37 | 38 | _START_GOOGLE_NAMESPACE_ 39 | 40 | // If you change this function, also change GetStackFrames below. 41 | int GetStackTrace(void** result, int max_depth, int skip_count) { 42 | static const int kStackLength = 64; 43 | void * stack[kStackLength]; 44 | int size; 45 | 46 | size = backtrace(stack, kStackLength); 47 | skip_count++; // we want to skip the current frame as well 48 | int result_count = size - skip_count; 49 | if (result_count < 0) 50 | result_count = 0; 51 | if (result_count > max_depth) 52 | result_count = max_depth; 53 | for (int i = 0; i < result_count; i++) 54 | result[i] = stack[i + skip_count]; 55 | 56 | return result_count; 57 | } 58 | 59 | _END_GOOGLE_NAMESPACE_ 60 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/stacktrace_libunwind-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2005 - 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Arun Sharma 31 | // 32 | // Produce stack trace using libunwind 33 | 34 | #include "utilities.h" 35 | 36 | extern "C" { 37 | #define UNW_LOCAL_ONLY 38 | #include 39 | } 40 | #include "glog/raw_logging.h" 41 | #include "stacktrace.h" 42 | 43 | _START_GOOGLE_NAMESPACE_ 44 | 45 | // Sometimes, we can try to get a stack trace from within a stack 46 | // trace, because libunwind can call mmap (maybe indirectly via an 47 | // internal mmap based memory allocator), and that mmap gets trapped 48 | // and causes a stack-trace request. If were to try to honor that 49 | // recursive request, we'd end up with infinite recursion or deadlock. 50 | // Luckily, it's safe to ignore those subsequent traces. In such 51 | // cases, we return 0 to indicate the situation. 52 | static bool g_now_entering = false; 53 | 54 | // If you change this function, also change GetStackFrames below. 55 | int GetStackTrace(void** result, int max_depth, int skip_count) { 56 | void *ip; 57 | int n = 0; 58 | unw_cursor_t cursor; 59 | unw_context_t uc; 60 | 61 | if (sync_val_compare_and_swap(&g_now_entering, false, true)) { 62 | return 0; 63 | } 64 | 65 | unw_getcontext(&uc); 66 | RAW_CHECK(unw_init_local(&cursor, &uc) >= 0, "unw_init_local failed"); 67 | skip_count++; // Do not include the "GetStackTrace" frame 68 | 69 | while (n < max_depth) { 70 | int ret = unw_get_reg(&cursor, UNW_REG_IP, (unw_word_t *) &ip); 71 | if (ret < 0) 72 | break; 73 | if (skip_count > 0) { 74 | skip_count--; 75 | } else { 76 | result[n++] = ip; 77 | } 78 | ret = unw_step(&cursor); 79 | if (ret <= 0) 80 | break; 81 | } 82 | 83 | g_now_entering = false; 84 | return n; 85 | } 86 | 87 | _END_GOOGLE_NAMESPACE_ 88 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/stacktrace_x86_64-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2005 - 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Arun Sharma 31 | // 32 | // Produce stack trace using libgcc 33 | 34 | extern "C" { 35 | #include // for NULL 36 | #include // ABI defined unwinder 37 | } 38 | #include "stacktrace.h" 39 | 40 | _START_GOOGLE_NAMESPACE_ 41 | 42 | typedef struct { 43 | void **result; 44 | int max_depth; 45 | int skip_count; 46 | int count; 47 | } trace_arg_t; 48 | 49 | 50 | // Workaround for the malloc() in _Unwind_Backtrace() issue. 51 | static _Unwind_Reason_Code nop_backtrace(struct _Unwind_Context *uc, void *opq) { 52 | return _URC_NO_REASON; 53 | } 54 | 55 | 56 | // This code is not considered ready to run until 57 | // static initializers run so that we are guaranteed 58 | // that any malloc-related initialization is done. 59 | static bool ready_to_run = false; 60 | class StackTraceInit { 61 | public: 62 | StackTraceInit() { 63 | // Extra call to force initialization 64 | _Unwind_Backtrace(nop_backtrace, NULL); 65 | ready_to_run = true; 66 | } 67 | }; 68 | 69 | static StackTraceInit module_initializer; // Force initialization 70 | 71 | static _Unwind_Reason_Code GetOneFrame(struct _Unwind_Context *uc, void *opq) { 72 | trace_arg_t *targ = (trace_arg_t *) opq; 73 | 74 | if (targ->skip_count > 0) { 75 | targ->skip_count--; 76 | } else { 77 | targ->result[targ->count++] = (void *) _Unwind_GetIP(uc); 78 | } 79 | 80 | if (targ->count == targ->max_depth) 81 | return _URC_END_OF_STACK; 82 | 83 | return _URC_NO_REASON; 84 | } 85 | 86 | // If you change this function, also change GetStackFrames below. 87 | int GetStackTrace(void** result, int max_depth, int skip_count) { 88 | if (!ready_to_run) 89 | return 0; 90 | 91 | trace_arg_t targ; 92 | 93 | skip_count += 1; // Do not include the "GetStackTrace" frame 94 | 95 | targ.result = result; 96 | targ.max_depth = max_depth; 97 | targ.skip_count = skip_count; 98 | targ.count = 0; 99 | 100 | _Unwind_Backtrace(GetOneFrame, &targ); 101 | 102 | return targ.count; 103 | } 104 | 105 | _END_GOOGLE_NAMESPACE_ 106 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/utilities_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Shinichiro Hamaji 31 | #include "utilities.h" 32 | #include "googletest.h" 33 | #include "glog/logging.h" 34 | 35 | #ifdef HAVE_LIB_GFLAGS 36 | #include 37 | using namespace GFLAGS_NAMESPACE; 38 | #endif 39 | 40 | using namespace GOOGLE_NAMESPACE; 41 | 42 | TEST(utilities, sync_val_compare_and_swap) { 43 | bool now_entering = false; 44 | EXPECT_FALSE(sync_val_compare_and_swap(&now_entering, false, true)); 45 | EXPECT_TRUE(sync_val_compare_and_swap(&now_entering, false, true)); 46 | EXPECT_TRUE(sync_val_compare_and_swap(&now_entering, false, true)); 47 | } 48 | 49 | TEST(utilities, InitGoogleLoggingDeathTest) { 50 | ASSERT_DEATH(InitGoogleLogging("foobar"), ""); 51 | } 52 | 53 | int main(int argc, char **argv) { 54 | InitGoogleLogging(argv[0]); 55 | InitGoogleTest(&argc, argv); 56 | 57 | CHECK_EQ(RUN_ALL_TESTS(), 0); 58 | } 59 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/windows/config.h: -------------------------------------------------------------------------------- 1 | /* src/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Namespace for Google classes */ 4 | #define GOOGLE_NAMESPACE google 5 | 6 | /* Stops putting the code inside the Google namespace */ 7 | #define _END_GOOGLE_NAMESPACE_ } 8 | 9 | /* Puts following code inside the Google namespace */ 10 | #define _START_GOOGLE_NAMESPACE_ namespace google { 11 | 12 | #if 0 13 | /* Always the empty-string on non-windows systems. On windows, should be 14 | "__declspec(dllexport)". This way, when we compile the dll, we export our 15 | functions/classes. It's safe to define this here because config.h is only 16 | used internally, to compile the DLL, and every DLL source file #includes 17 | "config.h" before anything else. */ 18 | #ifndef GOOGLE_GLOG_DLL_DECL 19 | # define GOOGLE_GLOG_IS_A_DLL 1 /* not set if you're statically linking */ 20 | # define GOOGLE_GLOG_DLL_DECL __declspec(dllexport) 21 | # define GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS __declspec(dllimport) 22 | #endif 23 | #else 24 | #define GOOGLE_GLOG_DLL_DECL 25 | #endif 26 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/windows/glog/log_severity.h: -------------------------------------------------------------------------------- 1 | // This file is automatically generated from src/glog/log_severity.h 2 | // using src/windows/preprocess.sh. 3 | // DO NOT EDIT! 4 | 5 | // Copyright (c) 2007, Google Inc. 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions are 10 | // met: 11 | // 12 | // * Redistributions of source code must retain the above copyright 13 | // notice, this list of conditions and the following disclaimer. 14 | // * Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions and the following disclaimer 16 | // in the documentation and/or other materials provided with the 17 | // distribution. 18 | // * Neither the name of Google Inc. nor the names of its 19 | // contributors may be used to endorse or promote products derived from 20 | // this software without specific prior written permission. 21 | // 22 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 26 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 28 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | 34 | #ifndef BASE_LOG_SEVERITY_H__ 35 | #define BASE_LOG_SEVERITY_H__ 36 | 37 | // Annoying stuff for windows -- makes sure clients can import these functions 38 | #ifndef GOOGLE_GLOG_DLL_DECL 39 | # if defined(_WIN32) && !defined(__CYGWIN__) 40 | # define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) 41 | # else 42 | # define GOOGLE_GLOG_DLL_DECL 43 | # endif 44 | #endif 45 | 46 | // Variables of type LogSeverity are widely taken to lie in the range 47 | // [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if 48 | // you ever need to change their values or add a new severity. 49 | typedef int LogSeverity; 50 | 51 | const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3, 52 | NUM_SEVERITIES = 4; 53 | #ifndef GLOG_NO_ABBREVIATED_SEVERITIES 54 | # ifdef ERROR 55 | # error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail. 56 | # endif 57 | const int INFO = GLOG_INFO, WARNING = GLOG_WARNING, 58 | ERROR = GLOG_ERROR, FATAL = GLOG_FATAL; 59 | #endif 60 | 61 | // DFATAL is FATAL in debug mode, ERROR in normal mode 62 | #ifdef NDEBUG 63 | #define DFATAL_LEVEL ERROR 64 | #else 65 | #define DFATAL_LEVEL FATAL 66 | #endif 67 | 68 | extern GOOGLE_GLOG_DLL_DECL const char* const LogSeverityNames[NUM_SEVERITIES]; 69 | 70 | // NDEBUG usage helpers related to (RAW_)DCHECK: 71 | // 72 | // DEBUG_MODE is for small !NDEBUG uses like 73 | // if (DEBUG_MODE) foo.CheckThatFoo(); 74 | // instead of substantially more verbose 75 | // #ifndef NDEBUG 76 | // foo.CheckThatFoo(); 77 | // #endif 78 | // 79 | // IF_DEBUG_MODE is for small !NDEBUG uses like 80 | // IF_DEBUG_MODE( string error; ) 81 | // DCHECK(Foo(&error)) << error; 82 | // instead of substantially more verbose 83 | // #ifndef NDEBUG 84 | // string error; 85 | // DCHECK(Foo(&error)) << error; 86 | // #endif 87 | // 88 | #ifdef NDEBUG 89 | enum { DEBUG_MODE = 0 }; 90 | #define IF_DEBUG_MODE(x) 91 | #else 92 | enum { DEBUG_MODE = 1 }; 93 | #define IF_DEBUG_MODE(x) x 94 | #endif 95 | 96 | #endif // BASE_LOG_SEVERITY_H__ 97 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/windows/port.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2008, Google Inc. 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above 11 | * copyright notice, this list of conditions and the following disclaimer 12 | * in the documentation and/or other materials provided with the 13 | * distribution. 14 | * * Neither the name of Google Inc. nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * --- 31 | * Author: Craig Silverstein 32 | * Copied from google-perftools and modified by Shinichiro Hamaji 33 | */ 34 | 35 | #ifndef _WIN32 36 | # error You should only be including windows/port.cc in a windows environment! 37 | #endif 38 | 39 | #include "config.h" 40 | #include // for va_list, va_start, va_end 41 | #include // for strstr() 42 | #include 43 | #include 44 | #include 45 | #include "port.h" 46 | 47 | using std::string; 48 | using std::vector; 49 | 50 | // These call the windows _vsnprintf, but always NUL-terminate. 51 | int safe_vsnprintf(char *str, size_t size, const char *format, va_list ap) { 52 | if (size == 0) // not even room for a \0? 53 | return -1; // not what C99 says to do, but what windows does 54 | str[size-1] = '\0'; 55 | return _vsnprintf(str, size-1, format, ap); 56 | } 57 | 58 | #ifndef HAVE_SNPRINTF 59 | int snprintf(char *str, size_t size, const char *format, ...) { 60 | va_list ap; 61 | va_start(ap, format); 62 | const int r = vsnprintf(str, size, format, ap); 63 | va_end(ap); 64 | return r; 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/src/windows/preprocess.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (c) 2008, Google Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | # --- 33 | # Author: Craig Silverstein 34 | # Copied from google-perftools and modified by Shinichiro Hamaji 35 | # 36 | # This script is meant to be run at distribution-generation time, for 37 | # instance by autogen.sh. It does some of the work configure would 38 | # normally do, for windows systems. In particular, it expands all the 39 | # @...@ variables found in .in files, and puts them here, in the windows 40 | # directory. 41 | # 42 | # This script should be run before any new release. 43 | 44 | if [ -z "$1" ]; then 45 | echo "USAGE: $0 " 46 | exit 1 47 | fi 48 | 49 | DLLDEF_MACRO_NAME="GLOG_DLL_DECL" 50 | 51 | # The text we put in every .h files we create. As a courtesy, we'll 52 | # include a helpful comment for windows users as to how to use 53 | # GLOG_DLL_DECL. Apparently sed expands \n into a newline. Good! 54 | DLLDEF_DEFINES="\ 55 | // NOTE: if you are statically linking the template library into your binary\n\ 56 | // (rather than using the template .dll), set '/D $DLLDEF_MACRO_NAME='\n\ 57 | // as a compiler flag in your project file to turn off the dllimports.\n\ 58 | #ifndef $DLLDEF_MACRO_NAME\n\ 59 | # define $DLLDEF_MACRO_NAME __declspec(dllimport)\n\ 60 | #endif" 61 | 62 | # Read all the windows config info into variables 63 | # In order for the 'set' to take, this requires putting all in a subshell. 64 | ( 65 | while read define varname value; do 66 | [ "$define" != "#define" ] && continue 67 | eval "$varname='$value'" 68 | done 69 | 70 | # Process all the .in files in the "glog" subdirectory 71 | mkdir -p "$1/windows/glog" 72 | for file in `echo "$1"/glog/*.in`; do 73 | echo "Processing $file" 74 | outfile="$1/windows/glog/`basename $file .in`" 75 | 76 | echo "\ 77 | // This file is automatically generated from $file 78 | // using src/windows/preprocess.sh. 79 | // DO NOT EDIT! 80 | " > "$outfile" 81 | # Besides replacing @...@, we also need to turn on dllimport 82 | # We also need to replace hash by hash_compare (annoying we hard-code :-( ) 83 | sed -e "s!@ac_windows_dllexport@!$DLLDEF_MACRO_NAME!g" \ 84 | -e "s!@ac_windows_dllexport_defines@!$DLLDEF_DEFINES!g" \ 85 | -e "s!@ac_cv_cxx_hash_map@!$HASH_MAP_H!g" \ 86 | -e "s!@ac_cv_cxx_hash_namespace@!$HASH_NAMESPACE!g" \ 87 | -e "s!@ac_cv_cxx_hash_set@!$HASH_SET_H!g" \ 88 | -e "s!@ac_cv_have_stdint_h@!0!g" \ 89 | -e "s!@ac_cv_have_systypes_h@!0!g" \ 90 | -e "s!@ac_cv_have_inttypes_h@!0!g" \ 91 | -e "s!@ac_cv_have_unistd_h@!0!g" \ 92 | -e "s!@ac_cv_have_uint16_t@!0!g" \ 93 | -e "s!@ac_cv_have_u_int16_t@!0!g" \ 94 | -e "s!@ac_cv_have___uint16@!1!g" \ 95 | -e "s!@ac_cv_have_libgflags@!0!g" \ 96 | -e "s!@ac_cv_have___builtin_expect@!0!g" \ 97 | -e "s!@ac_cv_cxx_using_operator@!1!g" \ 98 | -e "s!@ac_cv___attribute___noreturn@!!g" \ 99 | -e "s!@ac_cv___attribute___noinline@!!g" \ 100 | -e "s!@ac_cv___attribute___printf_4_5@!!g" \ 101 | -e "s!@ac_google_attribute@!${HAVE___ATTRIBUTE__:-0}!g" \ 102 | -e "s!@ac_google_end_namespace@!$_END_GOOGLE_NAMESPACE_!g" \ 103 | -e "s!@ac_google_namespace@!$GOOGLE_NAMESPACE!g" \ 104 | -e "s!@ac_google_start_namespace@!$_START_GOOGLE_NAMESPACE_!g" \ 105 | -e "s!@ac_htmlparser_namespace@!$HTMLPARSER_NAMESPACE!g" \ 106 | -e "s!\\bhash\\b!hash_compare!g" \ 107 | "$file" >> "$outfile" 108 | done 109 | ) < "$1/windows/config.h" 110 | 111 | # log_severity.h isn't a .in file. 112 | echo "\ 113 | // This file is automatically generated from $1/glog/log_severity.h 114 | // using src/windows/preprocess.sh. 115 | // DO NOT EDIT! 116 | " > "$1/windows/glog/log_severity.h" 117 | cat "$1/glog/log_severity.h" >> "$1/windows/glog/log_severity.h" 118 | 119 | echo "DONE" 120 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/test-driver: -------------------------------------------------------------------------------- 1 | /usr/share/automake-1.14/test-driver -------------------------------------------------------------------------------- /third-party/glog-0.3.4/vsprojects/libglog_static/libglog_static.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 25 | 28 | 31 | 34 | 37 | 40 | 51 | 54 | 57 | 60 | 63 | 66 | 69 | 72 | 75 | 78 | 79 | 87 | 90 | 93 | 96 | 99 | 102 | 113 | 116 | 119 | 122 | 125 | 128 | 131 | 134 | 137 | 140 | 141 | 142 | 143 | 144 | 145 | 148 | 151 | 152 | 155 | 156 | 159 | 160 | 163 | 164 | 167 | 168 | 169 | 172 | 175 | 176 | 179 | 180 | 183 | 184 | 187 | 188 | 191 | 192 | 195 | 196 | 199 | 200 | 203 | 204 | 207 | 208 | 211 | 212 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/vsprojects/logging_unittest/logging_unittest.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 26 | 29 | 32 | 35 | 38 | 41 | 53 | 56 | 59 | 62 | 69 | 72 | 75 | 78 | 81 | 84 | 87 | 90 | 91 | 99 | 102 | 105 | 108 | 111 | 114 | 126 | 129 | 132 | 135 | 144 | 147 | 150 | 153 | 156 | 159 | 162 | 165 | 166 | 167 | 168 | 169 | 170 | 175 | 178 | 179 | 180 | 185 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /third-party/glog-0.3.4/vsprojects/logging_unittest_static/logging_unittest_static.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 25 | 28 | 31 | 34 | 37 | 40 | 51 | 54 | 57 | 60 | 65 | 68 | 71 | 74 | 77 | 80 | 83 | 86 | 87 | 95 | 98 | 101 | 104 | 107 | 110 | 121 | 124 | 127 | 130 | 137 | 140 | 143 | 146 | 149 | 152 | 155 | 158 | 159 | 160 | 161 | 162 | 163 | 166 | 169 | 170 | 171 | 174 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | --------------------------------------------------------------------------------