From 9f6a7761d86b7e8d791575878fde5cde9b02a47e Mon Sep 17 00:00:00 2001 From: Joel Date: Sun, 13 Nov 2022 07:44:51 -0500 Subject: [PATCH] updates for release 2.1.0 (#309) The Github Action versions of checkout and setup-ruby have been updated. Some build instructions have been updated to use cmake build mode for increase portability. Google Test and Benchmark have been updated to recent commits. Doxygen generation has been fixed to account for the STUMPLESS_PUBLIC_FUNCTION function attribute. --- .github/workflows/analysis.yml | 6 +++--- .github/workflows/cygwin.yml | 2 +- .github/workflows/linux.yml | 18 ++++++++-------- .github/workflows/locale.yml | 28 ++++++++++++------------ .github/workflows/mac.yml | 12 +++++------ .github/workflows/windows.yml | 12 +++++------ README.md | 2 +- docs/SECURITY.md | 11 ++++++---- docs/development.md | 29 +++++++++++++++---------- docs/roadmap.md | 6 ++++++ docs/vision.md | 39 +++++++++++++++++----------------- src/entry.c | 5 +++-- src/target.c | 36 +++++++++++++------------------ tools/cmake/benchmark.cmake | 2 +- tools/cmake/cpp.cmake | 2 +- tools/cmake/cpp_test.cmake | 2 +- tools/cmake/google_libs.cmake | 4 ++-- tools/cmake/gtest.cmake | 2 +- tools/cmake/test.cmake | 4 ++-- tools/doxygen/Doxyfile.in | 2 ++ 20 files changed, 118 insertions(+), 106 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 0d9847ca7..f1e182dff 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -12,7 +12,7 @@ jobs: name: "custom analysis" runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Check Headers run: | tools/check_headers/check_headers.rb "include/**/*.h*" "include/**/**/*.h" @@ -36,7 +36,7 @@ jobs: language: [ 'cpp' ] steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: @@ -49,7 +49,7 @@ jobs: name: "sonarcloud analysis" runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Configure diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index 6c88bfd48..410c6448c 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -14,7 +14,7 @@ jobs: name: "cygwin, release" runs-on: "windows-2019" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache Google Test and Benchmark uses: actions/cache@v2 id: cache-google-libs diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ed00acbc4..7509059d8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -18,7 +18,7 @@ jobs: run: | sudo apt-get update sudo apt-get install doxygen libsystemd-dev valgrind - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -DCOVERAGE=ON -DCMAKE_BUILD_TYPE=Debug . @@ -64,7 +64,7 @@ jobs: name: "linux, release" runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr . @@ -106,7 +106,7 @@ jobs: name: "linux, release, static library" runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=OFF . @@ -148,7 +148,7 @@ jobs: name: "linux, all features disabled, debug" runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -DCOVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_JOURNALD_TARGETS=OFF -DENABLE_NETWORK_TARGETS=OFF -DENABLE_SOCKET_TARGETS=OFF -DENABLE_WINDOWS_EVENT_LOG_TARGETS=OFF -DENABLE_THREAD_SAFETY=OFF . @@ -173,7 +173,7 @@ jobs: name: "linux, all features disabled, release" runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_JOURNALD_TARGETS=OFF -DENABLE_NETWORK_TARGETS=OFF -DENABLE_SOCKET_TARGETS=OFF -DENABLE_WINDOWS_EVENT_LOG_TARGETS=OFF -DENABLE_THREAD_SAFETY=OFF . @@ -194,8 +194,8 @@ jobs: name: "linux, with c++, debug" runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-ruby@v1.1.2 + - uses: actions/checkout@v3 + - uses: actions/setup-ruby@v1.1.3 - name: Install Prereqs run: | sudo apt-get update @@ -227,8 +227,8 @@ jobs: name: "linux, with c++, release" runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-ruby@v1.1.2 + - uses: actions/checkout@v3 + - uses: actions/setup-ruby@v1.1.3 - name: Install Gems run: | gem install bundler diff --git a/.github/workflows/locale.yml b/.github/workflows/locale.yml index f93272e95..aab4ef86f 100644 --- a/.github/workflows/locale.yml +++ b/.github/workflows/locale.yml @@ -16,7 +16,7 @@ jobs: env: LANG: "de_DE.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -36,7 +36,7 @@ jobs: env: LANG: "cz_ES.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -56,7 +56,7 @@ jobs: env: LANG: "es_ES.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -76,7 +76,7 @@ jobs: env: LANG: "fr_FR.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -96,7 +96,7 @@ jobs: env: LANG: "it_IT.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -116,7 +116,7 @@ jobs: env: LANG: "sk_SK.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -136,7 +136,7 @@ jobs: env: LANG: "pl_PL.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -156,7 +156,7 @@ jobs: env: LANG: "sv_SE.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -176,7 +176,7 @@ jobs: env: LANG: "bg_BG.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -196,7 +196,7 @@ jobs: env: LANG: "el_GR.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -216,7 +216,7 @@ jobs: env: LANG: "pt_BR.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -236,7 +236,7 @@ jobs: env: LANG: "zh_CN.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -256,7 +256,7 @@ jobs: env: LANG: "hi_IN.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . @@ -276,7 +276,7 @@ jobs: env: LANG: "bn_IN.UTF-8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake . diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 6a1315eb8..98724ca4d 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -14,7 +14,7 @@ jobs: name: "debug" runs-on: "macos-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -DCOVERAGE=ON -DCMAKE_BUILD_TYPE=Debug . @@ -53,7 +53,7 @@ jobs: name: "release" runs-on: "macos-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -DCMAKE_BUILD_TYPE=Release . @@ -92,7 +92,7 @@ jobs: name: "release, static library" runs-on: "macos-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF . @@ -133,7 +133,7 @@ jobs: name: "all features disabled" runs-on: "macos-latest" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -DCOVERAGE=ON -DENABLE_JOURNALD_TARGETS=OFF -DENABLE_NETWORK_TARGETS=OFF -DENABLE_SOCKET_TARGETS=OFF -DENABLE_WINDOWS_EVENT_LOG_TARGETS=OFF -DENABLE_THREAD_SAFETY=OFF . @@ -158,8 +158,8 @@ jobs: name: "with c++" runs-on: "macos-latest" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-ruby@v1.1.2 + - uses: actions/checkout@v3 + - uses: actions/setup-ruby@v1.1.3 - name: Install Gems run: | gem install bundler diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7b05e1576..1d6d7a685 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,7 +14,7 @@ jobs: name: "windows, debug" runs-on: "windows-2019" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Debug . @@ -34,7 +34,7 @@ jobs: name: "windows, release" runs-on: "windows-2019" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release . @@ -54,7 +54,7 @@ jobs: name: "windows, release, static library" runs-on: "windows-2019" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF . @@ -74,7 +74,7 @@ jobs: name: "windows, all features disabled" runs-on: "windows-2019" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure run: | cmake -G "Visual Studio 16 2019" -DENABLE_JOURNALD_TARGETS=OFF -DENABLE_NETWORK_TARGETS=OFF -DENABLE_SOCKET_TARGETS=OFF -DCMAKE_BUILD_TYPE=Release -DENABLE_THREAD_SAFETY=OFF . @@ -91,8 +91,8 @@ jobs: name: "windows, with c++" runs-on: "windows-2019" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-ruby@v1.1.2 + - uses: actions/checkout@v3 + - uses: actions/setup-ruby@v1.1.3 - name: Install Gems run: | gem install bundler diff --git a/README.md b/README.md index d02ec18f7..1f2eef8bb 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ easier: * completely thread safe * can be adjusted or removed during compilation for zero runtime impact * localized for multiple languages :brazil: :bulgaria: :cn: :czech_republic: - :de: :es: :fr: :greece: :india: :it: :poland: :sweden: :slovakia: :us: + :de: :es: :fr: :greece: :india: :it: :poland: :slovakia: :sweden: :us: ([add yours!](https://github.com/goatshriek/stumpless/blob/latest/docs/localization.md)) * easy-access [documentation](https://goatshriek.github.io/stumpless/docs/c/latest/index.html), diff --git a/docs/SECURITY.md b/docs/SECURITY.md index 688fa71c5..697d7d228 100644 --- a/docs/SECURITY.md +++ b/docs/SECURITY.md @@ -1,18 +1,21 @@ # Stumpless Security Policy +This document describes the security support for Stumpless, including versions +that will be patched and the procedure for submitting vulnerabilities. ## Supported Versions - -The table below lists the current supported versions of Stumpless. +The table below lists the current supported versions of Stumpless. Generally, +the current and previous major versions are supported at their highest minor +version. | Version | Supported | | ------- | ------------------ | | 2.1.x | :heavy_check_mark: | -| 2.0.x | :heavy_check_mark: | +| 2.0.x | :x: | | 1.6.x | :heavy_check_mark: | | <= 1.5 | :x: | -## Reporting a Vulnerability +## Reporting a Vulnerability If you discover a problem with Stumpless, please report it immediately to the project owner, [Joel Anderson](mailto:joelanderson333@gmail.com). The issue will be investigated as soon as possible and you will receive a response within diff --git a/docs/development.md b/docs/development.md index 2fe69db72..37b1c4eb9 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,10 +1,9 @@ # Developing Stumpless - If you're going to work on the library itself, here are some helpful tips that will make the experience a little smoother and faster. -## Getting Started +## Getting Started Stumpless is configured using the popular [CMake](https://cmake.org/) build platform. In order to build it from the source you will need this tool available, as well as any of a number of supported build systems. @@ -47,17 +46,25 @@ cmake ../stumpless # after the above initial commands, a normal development cycle would be: -# update a few files (your favorite editor - here we use vim) +# update a few files with your favorite editor - here we use vim vim ../stumpless/src/target.c # build and run the test suite -# change the number of threads with the j parameter to make things faster +# add a parallel argument to make things faster # your processor's core count is a good starting place -make -j 4 check +cmake --build . --parallel 4 --target check + +# for multi-config systems like Visual Studio, you'll also need to add a config +# argument to every build command to use the intended config +cmake --build . --parallel 4 --config x64-Debug --target check + +# you can be more specific to your own environment if you'd like +# for example, if you're using make as your build system, you could just do: +# make -j 4 check # if you want to build a single test, you can do this using the executable # name, which for functionality tests is function-test- -make -j 4 function-test-target && ./function-test-target +cmake --build . --target --parallel 4 function-test-target && ./function-test-target ``` More details about building the library are available in the @@ -97,8 +104,8 @@ A few other documents may be helpful for newcomers to glance through: implementation approach. Be sure that you follow the principles outlined here for any new functionality you implement. -## Error Handling +## Error Handling Stumpless has a framework for handling errors that happen at runtime. If you are writing new functionality or extending something that already exists then you will need to make sure that this framework is used whenever an @@ -163,8 +170,8 @@ functions provided for the user. Some of the common useful ones are: * `stumpless_has_error` is true if the last call failed, false if it succeeded * `stumpless_perror` prints the current error if there is one -## Adding new functions +## Adding new functions If you're adding a new function to stumpless, here are a few notes that will help you along the way. @@ -220,8 +227,8 @@ the second has functions and symbols that are only used internally. Adding your function and the associated header it is declared in to the correct manifest will resolve this error as the tool will now know why the include is required. -## Continuous Integration Tools +## Continuous Integration Tools Stumpless uses a number of CI tools to test builds and monitor code coverage and quality. These tools each have badges in the project [README](../README.md) that link to their respective pages. @@ -267,8 +274,8 @@ output of any of these tools, consider temporarily removing the adding it back before creating a pull request. This conserves build resources and may allow your pull request to pass its checks faster. -## Caching Google Test and Benchmark +## Caching Google Test and Benchmark If you are going to be repeatedly building the library from scratch, for example to ensure nothing is cached between builds or to try different configurations, it will quickly become tedious to wait for the Google Test and/or Benchmark @@ -341,8 +348,8 @@ make check make bench ``` -## Other development notes +## Other development notes For a detailed discussion of the performance testing framework used to gauge the speed and efficiency of various calls, check out the [benchmark](benchmark.md) documentation for the basic strategy and a full diff --git a/docs/roadmap.md b/docs/roadmap.md index 19ffaa816..122f03296 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -23,6 +23,8 @@ or want to make a suggestion, please submit an issue on the project's Removing previously deprecated feature. * [REMOVE] **Stream target constructor using `int` facility** Removing previously deprecated feature. + * [REMOVE] **entry id field** + Removing unused field. * [CHANGE] **Python language bindings to Wrapture instead of SWIG** The [Wrapture](https://github.com/goatshriek/wrapture) project is being built to provide clean, readable, and explicit language binding functionality @@ -54,8 +56,12 @@ or want to make a suggestion, please submit an issue on the project's * [ADD] **Database logging target** * [ADD] **REST endpoint logging target** * [ADD] **Hyperledger/blockchain logging target** + * [ADD] **Apache Kafka logging target** * [ADD] **Ability to limit the rate of logging (per message, per byte)** * [ADD] **Logging target for Windows Debug log** + * [ADD] **Error callbacks** + Allow the user to define actions to take when specific errors are + encountered. * [ADD] **Configuration file support** Many other logging solutions provide a way to configure logging via a separate configuration file that defines targets and their options. Stumpless diff --git a/docs/vision.md b/docs/vision.md index e9e9933d0..f4d3b6720 100644 --- a/docs/vision.md +++ b/docs/vision.md @@ -1,5 +1,4 @@ # Make debug all possible - This is a lofty goal. The current standard practice is to keep logging at a high level and only turn on debug when needed, and even then only for troublesome components. And this is for good reason. Consider the pitfall of issuing the @@ -10,10 +9,10 @@ unintentionally wreaking havoc. But does this have to be the state of things? Logging is often implemented as an afterthought, assumed to be a minimum load on the system. And when it isn't, -we simply throttle back the messages we see, potentially missing out on valuable -information and causing application restarts just to adjust levels. +we simply throttle back the messages we record, potentially missing out on +valuable information and causing application restarts just to adjust levels. -The stumpless project aims to make logging more efficient while less of a hassle +The Stumpless project aims to make logging more efficient while less of a hassle for developers to include. This is the primary design goal: a rich and intuitive interface that is as unobtrusive as possible while still being flexible enough to range from a simple "log this string" to logging structured data. All of this @@ -26,27 +25,36 @@ Faster execution, multi-thread and multi-process support, and strong compression are all tactics brought to bear to keep logging overhead to an absolute minimum. By offering these functions directly from the library, stumpless allows -applications to converge log generation and sendoff into the application itself. -This removes the need for a separate logging daemon for the same functionality, -reducing integration points and interdependencies and making for a more robust -and efficient end product. +applications to converge log generation and transmission into the application +itself. This removes the need for a separate logging daemon for the same +functionality, reducing integration points and interdependencies and making for +a more robust and efficient end product. -# Things this isn't +# What makes this special? +There are a number of other logging libraries for C, boasting a variety of +features including header-only, various target selections, and structured data +options. Stumpless aims to bring the most useful of these features together in a +single performant library built with modern development practices including test +driven development and continuous integration. We hope to create a viable option +for developers needing a lightweight and standardized logging library. + + +# Things this isn't The only problem this library aims to solve is how to create log messages and send them on their journey home. There are certainly other logging-related tasks that are important, but this project doesn't do them. Most notably: -### Log Analysis +### Log Analysis Log parsing, indexing, storage, and analysis are huge tasks that already have a number of high-profile solutions focused on them. While stumpless is built to complement them, it certainly does not provide any of their features. You should instead look to projects like [Splunk](https://www.splunk.com/) or [ELK stack](https://www.elastic.co/elk-stack) for this. -### Log Management +### Log Management While stumpless can send logs in a variety of ways, it does not necessarily manage end-to-end transport or the final storage. There are plenty of log forwarding and collection solutions already available such as @@ -61,12 +69,3 @@ There are some features of stumpless that might overlap with these tools, such as log file rotation. If this is truly all that you need, then rejoice! However, take care that you are able to recognize when you are looking for a feature that is out of scope of what stumpless provides and begin to look elsewhere. - -# What makes this special? - -There are a number of other logging libraries for C, boasting a variety of -features including header-only, various target selections, and structured data -options. Stumpless aims to bring the most useful of these features together in a -single performant library built with modern development practices including test -driven development and continuous integration. We hope to create a viable option -for developers needing a lightweight and standardized logging library. diff --git a/src/entry.c b/src/entry.c index e272b61c3..e3482b4ed 100644 --- a/src/entry.c +++ b/src/entry.c @@ -401,7 +401,7 @@ stumpless_get_entry_facility( const struct stumpless_entry *entry ) { const char * stumpless_get_entry_hostname( const struct stumpless_entry *entry ) { struct strbuilder *hostname_builder; - char *hostname; + const char *hostname; VALIDATE_ARG_NOT_NULL( entry ); @@ -753,7 +753,8 @@ stumpless_set_entry_hostname( struct stumpless_entry *entry, entry->hostname_length = 0; } else { - // the setter should return the modified entry in the case of success, and NULL if not. + // the setter returns the modified entry in the case of success, or NULL + // on failure if( !validate_printable_ascii( hostname ) || !validate_hostname_length( hostname ) ) { return NULL; diff --git a/src/target.c b/src/target.c index 4856070c9..9c69cde30 100644 --- a/src/target.c +++ b/src/target.c @@ -326,6 +326,15 @@ stumpless_close_target( struct stumpless_target *target ) { } } +FILE * +stumpless_get_cons_stream( void ) { + if( config_read_bool( &cons_stream_valid ) ) { + return config_read_ptr( &cons_stream ); + } else { + return stdout; + } +} + struct stumpless_target * stumpless_get_current_target( void ) { struct stumpless_target *result; @@ -413,9 +422,6 @@ stumpless_get_target_default_app_name( const struct stumpless_target *target ) { VALIDATE_ARG_NOT_NULL( target ); lock_target( target ); - if( !target->default_app_name ) { - goto cleanup_and_return; - } name_copy = alloc_mem( target->default_app_name_length + 1 ); if( !name_copy ) { @@ -440,9 +446,6 @@ stumpless_get_target_default_msgid( const struct stumpless_target *target ) { VALIDATE_ARG_NOT_NULL( target ); lock_target( target ); - if( !target->default_msgid ) { - goto cleanup_and_return; - } msgid_copy = alloc_mem( target->default_msgid_length + 1 ); if( !msgid_copy ) { @@ -528,6 +531,12 @@ stumpless_open_target( struct stumpless_target *target ) { return result; } +void +stumpless_set_cons_stream( FILE *stream ) { + config_write_ptr( &cons_stream, stream ); + config_write_bool( &cons_stream_valid, true ); +} + void stumpless_set_current_target( struct stumpless_target *target ) { clear_error( ); @@ -1074,18 +1083,3 @@ unsupported_target_is_open( const struct stumpless_target *target ) { raise_target_unsupported( L10N_UNSUPPORTED_TARGET_IS_OPEN_ERROR_MESSAGE ); return 0; } - -FILE * -stumpless_get_cons_stream( void ) { - if( config_read_bool( &cons_stream_valid ) ) { - return config_read_ptr( &cons_stream ); - } else { - return stdout; - } -} - -void -stumpless_set_cons_stream( FILE *stream ) { - config_write_ptr( &cons_stream, stream ); - config_write_bool( &cons_stream_valid, true ); -} diff --git a/tools/cmake/benchmark.cmake b/tools/cmake/benchmark.cmake index 11bda223b..5c22fa54d 100644 --- a/tools/cmake/benchmark.cmake +++ b/tools/cmake/benchmark.cmake @@ -31,7 +31,7 @@ if(${benchmark_lib} STREQUAL "benchmark_lib-NOTFOUND" OR ${benchmark_main_lib} S ) ExternalProject_Add(benchmark - URL https://github.com/google/benchmark/archive/6d51a119ff7cacc8f1691c1977e190a25a227847.zip + URL https://github.com/google/benchmark/archive/d572f4777349d43653b21d6c2fc63020ab326db2.zip PREFIX ${CMAKE_CURRENT_BINARY_DIR}/benchmark CMAKE_ARGS -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DCMAKE_SH=${CMAKE_SH} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${google_libs_cxx_flags} INSTALL_COMMAND "" diff --git a/tools/cmake/cpp.cmake b/tools/cmake/cpp.cmake index b3ad0e2b1..4cd808a23 100644 --- a/tools/cmake/cpp.cmake +++ b/tools/cmake/cpp.cmake @@ -188,7 +188,7 @@ if(MINGW) endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - target_compile_options(stumplesscpp PUBLIC "-std=c++11") + target_compile_options(stumplesscpp PUBLIC "-std=c++14") endif() add_cpp_test(element diff --git a/tools/cmake/cpp_test.cmake b/tools/cmake/cpp_test.cmake index ee60ddd50..d37b52ba7 100644 --- a/tools/cmake/cpp_test.cmake +++ b/tools/cmake/cpp_test.cmake @@ -3,7 +3,7 @@ if(MSVC) # platform-dependent code, such as the _s functions, just for tests set(cpp_test_compile_flags "-D_CRT_SECURE_NO_WARNINGS") else() - set(cpp_test_compile_flags "-std=c++11") + set(cpp_test_compile_flags "-std=gnu++14") endif(MSVC) function(private_add_cpp_test) diff --git a/tools/cmake/google_libs.cmake b/tools/cmake/google_libs.cmake index f81a5e36b..eb1f814fd 100644 --- a/tools/cmake/google_libs.cmake +++ b/tools/cmake/google_libs.cmake @@ -26,7 +26,7 @@ else() endif() if(CYGWIN) - set(google_libs_cxx_flags "-std=gnu++11") + set(google_libs_cxx_flags "-std=gnu++14") else() - set(google_libs_cxx_flags "-std=c++11") + set(google_libs_cxx_flags "-std=c++14") endif() diff --git a/tools/cmake/gtest.cmake b/tools/cmake/gtest.cmake index 3a3bd75c7..ab669c133 100644 --- a/tools/cmake/gtest.cmake +++ b/tools/cmake/gtest.cmake @@ -66,7 +66,7 @@ if(${gtest_lib} STREQUAL "gtest_lib-NOTFOUND" OR ${gtest_main_lib} STREQUAL "gte ) ExternalProject_Add(gtest - URL https://github.com/google/googletest/archive/0b7798b2fba340969a0cf83698e5c0a2e25b7dbc.zip + URL https://github.com/google/googletest/archive/44c03643cfbc649488a0f437cd18e05f11960d19.zip PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest CMAKE_ARGS -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_SH=${CMAKE_SH} -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS=${google_libs_cxx_flags} UPDATE_COMMAND "" diff --git a/tools/cmake/test.cmake b/tools/cmake/test.cmake index 5ca7bbd64..9fb5cc48b 100644 --- a/tools/cmake/test.cmake +++ b/tools/cmake/test.cmake @@ -5,8 +5,8 @@ if(MSVC) # platform-dependent code, such as the _s functions, just for tests set(function_test_compile_flags "-D_CRT_SECURE_NO_WARNINGS -DGTEST_LINKED_AS_SHARED_LIBRARY=1") else() - set(function_test_compile_flags "-std=gnu++11 -DGTEST_LINKED_AS_SHARED_LIBRARY=1") - set(performance_test_compile_flags "-std=gnu++11") + set(function_test_compile_flags "-std=gnu++14 -DGTEST_LINKED_AS_SHARED_LIBRARY=1") + set(performance_test_compile_flags "-std=gnu++14") endif(MSVC) function(private_add_function_test) diff --git a/tools/doxygen/Doxyfile.in b/tools/doxygen/Doxyfile.in index bf4026f01..3a4682860 100644 --- a/tools/doxygen/Doxyfile.in +++ b/tools/doxygen/Doxyfile.in @@ -15,6 +15,8 @@ SEARCH_INCLUDES = YES INCLUDE_PATH = @PROJECT_SOURCE_DIR@/include @PROJECT_BINARY_DIR@/include MACRO_EXPANSION = YES ENABLE_PREPROCESSING = YES +EXPAND_ONLY_PREDEF = YES +PREDEFINED = __attribute__(x)= # default generated settings BRIEF_MEMBER_DESC = YES