refactor: rename PIP_NO_\* to PIP_HAS_\* with inverted logic
All feature flags now use positive naming (enabled by default): - PIP_HAS_FILESYSTEM, PIP_HAS_THREADS, PIP_HAS_SOCKET - PIP_HAS_PROCESS, PIP_HAS_DYNLIB, PIP_HAS_FFT, PIP_HAS_SERIAL Preprocessor guards inverted: - #ifndef PIP_NO_X → #ifdef PIP_HAS_X - #ifdef PIP_NO_X → #ifndef PIP_HAS_X CMake options default ON instead of OFF. Platform blocks set flags OFF to disable features. 85 files transformed via Python script + 2 manual fixes.
This commit is contained in:
@@ -99,7 +99,7 @@ void PITransitionBase::trigger() {
|
||||
|
||||
PITransitionTimeout::PITransitionTimeout(PIStateBase * source, PIStateBase * target, PISystemTime timeout)
|
||||
: PITransitionBase(source, target, 0) {
|
||||
#ifndef PIP_NO_THREADS
|
||||
#ifdef PIP_HAS_THREADS
|
||||
timer.setInterval(timeout);
|
||||
timer.setSlot([this] {
|
||||
trigger();
|
||||
@@ -110,21 +110,21 @@ PITransitionTimeout::PITransitionTimeout(PIStateBase * source, PIStateBase * tar
|
||||
|
||||
|
||||
PITransitionTimeout::~PITransitionTimeout() {
|
||||
#ifndef PIP_NO_THREADS
|
||||
#ifdef PIP_HAS_THREADS
|
||||
timer.stopAndWait();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void PITransitionTimeout::enabled() {
|
||||
#ifndef PIP_NO_THREADS
|
||||
#ifdef PIP_HAS_THREADS
|
||||
timer.start();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void PITransitionTimeout::disabled() {
|
||||
#ifndef PIP_NO_THREADS
|
||||
#ifdef PIP_HAS_THREADS
|
||||
timer.stop();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ private:
|
||||
void enabled() override;
|
||||
void disabled() override;
|
||||
|
||||
#ifndef PIP_NO_THREADS
|
||||
#ifdef PIP_HAS_THREADS
|
||||
PITimer timer;
|
||||
#endif
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user