New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
broker: declare and define per module #2253
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We no longer need to specify each Broker type in broker.h But, we exchange that bit for explicit initialization of the instance Define helper macros to generate boilerplate code - namespace with Instance, Register(), Publish() - forward Register(...) -> Instance.Register(...), Publish(...) -> Instance.Publish(...)
I think maybe the header adjustment in this commit are causing these build errors?
|
Looks like it. Does this help? diff --git a/code/espurna/broker.h b/code/espurna/broker.h
index 8fd9361c..bc34dc2d 100644
--- a/code/espurna/broker.h
+++ b/code/espurna/broker.h
@@ -8,6 +8,8 @@ Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
#pragma once
+#include "espurna.h"
+
#include <functional>
#include <utility>
#include <vector>
diff --git a/code/espurna/espurna.h b/code/espurna/espurna.h
index 9fe0c8a2..89d2587c 100644
--- a/code/espurna/espurna.h
+++ b/code/espurna/espurna.h
@@ -24,9 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config/all.h"
#include "board.h"
-#include "broker.h"
#include "debug.h"
#include "compat.h"
+#include "broker.h"
#include "wifi.h"
#include "storage_eeprom.h"
#include "gpio.h" compat should be loaded before broker, min() and max() are macros with Core 2.3.0 |
Yes, it does. |
yes, thank you |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We no longer need to specify each Broker type in broker.h
But, we exchange that bit for explicit initialization of the instance
Preserve existing syntax of ::Register & ::Publish so we don't have to change call sites, but only initialization code. I'd expect that we do something different in the future, delay breaking things until then.
Define helper macros to generate boilerplate code
Publish(...) -> Instance.Publish(...)
re #2233