Skip to content

Commit

Permalink
Force using C++11, since that is required for this project
Browse files Browse the repository at this point in the history
  • Loading branch information
ToMe25 committed Jan 11, 2024
1 parent fe3eaf0 commit 7586010
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/utils/include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#ifndef SRC_UTILS_H_
#define SRC_UTILS_H_

#include <cstddef>
#include <string>

namespace utils {
Expand Down
13 changes: 8 additions & 5 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[platformio]
name = "ESP WiFi Thermometer"
default_envs =
default_envs =
esp32dev
esp32dev_debug
esp32dev_ota
Expand All @@ -29,27 +29,30 @@ framework = arduino
monitor_speed = 115200
upload_speed = 921600
extra_scripts = post:shared/compress_web.py
lib_deps =
lib_deps =
ArduinoOTA
ESPAsyncWebServer = https://github.com/me-no-dev/ESPAsyncWebServer.git
marvinroger/AsyncMqttClient@^0.9.0
adafruit/DHT sensor library@^1.4.4
milesburton/DallasTemperature@^3.11.0
board_build.embed_txtfiles =
board_build.embed_txtfiles =
wifissid.txt
wifipass.txt
otapass.txt
mqttuser.txt
mqttpass.txt
data/index.html
data/error.html
board_build.embed_files =
board_build.embed_files =
data/gzip/main.css.gz
data/gzip/index.js.gz
data/gzip/manifest.json.gz
data/gzip/favicon.ico.gz
data/gzip/favicon.png.gz
data/gzip/favicon.svg.gz
build_flags =
-std=c++11
-Wall
test_framework = unity

[debug]
Expand All @@ -58,7 +61,7 @@ build_flags = -D CORE_DEBUG_LEVEL=5

[env:native]
platform = native
framework =
framework =
lib_deps = UZLibGzipWrapper

[env:native_debug]
Expand Down
4 changes: 2 additions & 2 deletions test/test_uzlib_gzip_wrapper/decompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ void setUp() {
if (uncompressed_path) {
const size_t u_len = std::strlen(uncompressed_path);
compressed_path = new char[u_len + 4]; // 3 for .gz plus NUL byte.
strncpy(compressed_path, uncompressed_path, u_len);
strncpy(compressed_path, uncompressed_path, u_len + 1);
strncpy(compressed_path + u_len, ".gz", 4);

const size_t bc_len = std::strlen(BASE_COMMAND);
compress_command = new char[bc_len + u_len + 1];
strncpy(compress_command, BASE_COMMAND, bc_len);
strncpy(compress_command, BASE_COMMAND, bc_len + 1);
strncpy(compress_command + bc_len, uncompressed_path, u_len + 1);
}

Expand Down

0 comments on commit 7586010

Please sign in to comment.