diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-01-25 20:31:33 (GMT) |
---|---|---|
committer | Regina Pfeifer <regina@mailbox.org> | 2019-01-29 15:32:52 (GMT) |
commit | bcee24aecc1eaf6615eac9f24ae06acdf38845d3 (patch) | |
tree | 7a5ce493d66e1ff9a154bbd7503bd6e646624444 /Source/cmake.h | |
parent | 9620cb935a49e7b4955f5b1d0ffa2e93b4327591 (diff) | |
download | CMake-bcee24aecc1eaf6615eac9f24ae06acdf38845d3.zip CMake-bcee24aecc1eaf6615eac9f24ae06acdf38845d3.tar.gz CMake-bcee24aecc1eaf6615eac9f24ae06acdf38845d3.tar.bz2 |
Use `std::function` for callbacks
Diffstat (limited to 'Source/cmake.h')
-rw-r--r-- | Source/cmake.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmake.h b/Source/cmake.h index c60fc33..afd4117 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <functional> #include <map> #include <memory> // IWYU pragma: keep #include <set> @@ -271,7 +272,7 @@ public: ///! Parse command line arguments that might set cache values bool SetCacheArgs(const std::vector<std::string>&); - typedef void (*ProgressCallbackType)(const char* msg, float progress, void*); + using ProgressCallbackType = std::function<void(const char*, float)>; /** * Set the function used by GUIs to receive progress updates * Function gets passed: message as a const char*, a progress @@ -279,7 +280,7 @@ public: * number provided may be negative in cases where a message is * to be displayed without any progress percentage. */ - void SetProgressCallback(ProgressCallbackType f, void* clientData = nullptr); + void SetProgressCallback(ProgressCallbackType f); ///! this is called by generators to update the progress void UpdateProgress(const char* msg, float prog); @@ -485,7 +486,6 @@ protected: private: ProgressCallbackType ProgressCallback; - void* ProgressCallbackClientData; bool InTryCompile; WorkingMode CurrentWorkingMode; bool DebugOutput; |