From f41a509f6dfe18462ffc8b0e235982ddd7064a0b Mon Sep 17 00:00:00 2001 From: Rico Tiongson Date: Sun, 3 Mar 2019 22:56:37 +0800 Subject: [PATCH] Remove underscores from value-defined macros --- cpp/_macro.cpp | 12 ++++++------ cpp/service/buffer.cpp | 2 +- cpp/service/status.cpp | 4 ++-- setup.py | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cpp/_macro.cpp b/cpp/_macro.cpp index 332bf51..bffa78a 100644 --- a/cpp/_macro.cpp +++ b/cpp/_macro.cpp @@ -1,12 +1,12 @@ #ifndef __COMFORTABLE_SWIPE__macro_hpp__ #define __COMFORTABLE_SWIPE__macro_hpp__ -#ifndef __COMFORTABLE_SWIPE__CONFIG__ -#warning "__COMFORTABLE_SWIPE__CONFIG__ must be defined." -#endif /* __COMFORTABLE_SWIPE__CONFIG__ */ +#ifndef COMFORTABLE_SWIPE_CONFIG +#error "COMFORTABLE_SWIPE_CONFIG must be defined." +#endif /* COMFORTABLE_SWIPE_CONFIG */ -#ifndef __COMFORTABLE_SWIPE__VERSION__ -#warning "__COMFORTABLE_SWIPE__VERSION__ must be defined." -#endif /* __COMFORTABLE_SWIPE__VERSION__ */ +#ifndef COMFORTABLE_SWIPE_VERSION +#warning "COMFORTABLE_SWIPE_VERSION is not defined." +#endif /* COMFORTABLE_SWIPE_VERSION */ #endif /* __COMFORTABLE_SWIPE__macro_hpp__ */ diff --git a/cpp/service/buffer.cpp b/cpp/service/buffer.cpp index 2b6b625..082943e 100644 --- a/cpp/service/buffer.cpp +++ b/cpp/service/buffer.cpp @@ -32,7 +32,7 @@ namespace comfortable_swipe::service void buffer() { // read config file - auto config = comfortable_swipe::util::read_config_file(__COMFORTABLE_SWIPE__CONFIG__); + auto config = comfortable_swipe::util::read_config_file(COMFORTABLE_SWIPE_CONFIG); // initialize swipe gesture handler comfortable_swipe::gesture::swipe_gesture swipe_gesture_handler diff --git a/cpp/service/status.cpp b/cpp/service/status.cpp index f745937..0aae353 100644 --- a/cpp/service/status.cpp +++ b/cpp/service/status.cpp @@ -42,8 +42,8 @@ namespace comfortable_swipe::service // check status of configuration file try { - std::puts(__COMFORTABLE_SWIPE__CONFIG__); - auto config = comfortable_swipe::util::read_config_file(__COMFORTABLE_SWIPE__CONFIG__); + std::puts(COMFORTABLE_SWIPE_CONFIG); + auto config = comfortable_swipe::util::read_config_file(COMFORTABLE_SWIPE_CONFIG); // print threshold if (config.count("threshold") > 0) { diff --git a/setup.py b/setup.py index f146c6a..e92b294 100644 --- a/setup.py +++ b/setup.py @@ -45,8 +45,8 @@ try: # for C++ library cpp_macros = dict( - __COMFORTABLE_SWIPE__VERSION__='"{}"'.format(VERSION), - __COMFORTABLE_SWIPE__CONFIG__='"{}"'.format(CONFIG) + COMFORTABLE_SWIPE_VERSION='"{}"'.format(VERSION), + COMFORTABLE_SWIPE_CONFIG='"{}"'.format(CONFIG) ) # read C++ libraries for comfortable swipe