mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
compile native on OSX
This commit is contained in:
@@ -47,7 +47,7 @@ the LICENSE file.
|
||||
#include <mutex> // NOLINT [build/c++11]
|
||||
#define EMC_SEMAPHORE_TAKE() mtx.lock();
|
||||
#define EMC_SEMAPHORE_GIVE() mtx.unlock();
|
||||
#elif defined(_WIN32)
|
||||
#elif defined(_WIN32) || defined(__APPLE__)
|
||||
#include <Arduino.h>
|
||||
#define EMC_SEMAPHORE_TAKE()
|
||||
#define EMC_SEMAPHORE_GIVE()
|
||||
|
||||
@@ -6,8 +6,6 @@ For a copy, see <https://opensource.org/licenses/MIT> or
|
||||
the LICENSE file.
|
||||
*/
|
||||
|
||||
#if defined(__linux__) || defined(_WIN32)
|
||||
|
||||
#include "ClientPosixIPAddress.h"
|
||||
|
||||
IPAddress::IPAddress()
|
||||
@@ -28,5 +26,3 @@ IPAddress::IPAddress(uint32_t address)
|
||||
IPAddress::operator uint32_t() {
|
||||
return _address;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -120,7 +120,7 @@ espMqttClient::espMqttClient()
|
||||
, _client() {
|
||||
_transport = &_client;
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
#elif defined(_WIN32) || defined(__APPLE__)
|
||||
// Windows
|
||||
espMqttClient::espMqttClient()
|
||||
: MqttClientSetup(espMqttClientTypes::UseInternalTask::NO) {
|
||||
|
||||
@@ -76,7 +76,7 @@ class espMqttClient : public MqttClientSetup<espMqttClient> {
|
||||
protected:
|
||||
espMqttClientInternals::ClientPosix _client;
|
||||
};
|
||||
#elif defined(_WIN32)
|
||||
#elif defined(_WIN32) || defined(__APPLE__)
|
||||
class espMqttClient : public MqttClientSetup<espMqttClient> {
|
||||
public:
|
||||
espMqttClient();
|
||||
|
||||
@@ -260,7 +260,7 @@ lib_ignore = Module EMS-ESP-Modules
|
||||
|
||||
; unit tests
|
||||
; pio run -e native-test -t exec
|
||||
; works on Linux and Windows
|
||||
; works on Linux, Windows, and MacOS
|
||||
[env:native-test]
|
||||
platform = native
|
||||
test_build_src = true
|
||||
|
||||
@@ -532,7 +532,8 @@ static void setup_commands(std::shared_ptr<Commands> & commands) {
|
||||
|
||||
JsonDocument doc;
|
||||
int8_t id = -1;
|
||||
const char * cmd = Helpers::toLower(arguments[1]).c_str();
|
||||
auto arg = Helpers::toLower(arguments[1]);
|
||||
const char * cmd = arg.c_str(); // prevent loosing pointer after object destruction
|
||||
uint8_t return_code = CommandRet::OK;
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
bool has_data = false;
|
||||
|
||||
Reference in New Issue
Block a user