Skip to content

Commit 453d2a5

Browse files
authoredJul 30, 2020
Merge pull request #16 from gwint/master
Add inline to objects in dotenv.h to prevent multiple definition erro…
2 parents 49f1810 + 3efa9ea commit 453d2a5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed
 

‎CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cmake_minimum_required(VERSION 3.10)
33
project(cpp-dotenv VERSION 0.2.0)
44

5-
set(CMAKE_CXX_STANDARD 11)
5+
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
77

88
#----------------------- LIBRARY CONFIGURATION -------------------------

‎dotenv.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -444,15 +444,15 @@ namespace dotenv
444444
};
445445

446446

447-
const container parser::SP
447+
inline const container parser::SP
448448
{
449449
container::CHAR_MODE::INCLUDE,
450450
SP_C,
451451
TB_C
452452
};
453453

454454

455-
const container parser::UNQUOTED_KEY_CHAR
455+
inline const container parser::UNQUOTED_KEY_CHAR
456456
{
457457
container::CHAR_MODE::EXCLUDE,
458458
CS_C,
@@ -466,7 +466,7 @@ namespace dotenv
466466
};
467467

468468

469-
const container parser::UNQUOTED_VALUE_CHAR
469+
inline const container parser::UNQUOTED_VALUE_CHAR
470470
{
471471
container::CHAR_MODE::EXCLUDE,
472472
CS_C,
@@ -479,14 +479,14 @@ namespace dotenv
479479
};
480480

481481

482-
const container parser::UNQUOTED_COMMENT_CHAR
482+
inline const container parser::UNQUOTED_COMMENT_CHAR
483483
{
484484
container::CHAR_MODE::EXCLUDE,
485485
NL_C,
486486
CR_C
487487
};
488488

489-
const std::vector<std::pair<char, char>> parser::ESCAPED_EQUIVALENCES
489+
inline const std::vector<std::pair<char, char>> parser::ESCAPED_EQUIVALENCES
490490
{
491491
{ '?' , '?' },
492492
{ '\'', '\'' },
@@ -570,9 +570,9 @@ namespace dotenv
570570
};
571571

572572

573-
const std::string dotenv::env_filename = ".env";
574-
dotenv dotenv::_instance;
573+
inline const std::string dotenv::env_filename = ".env";
574+
inline dotenv dotenv::_instance;
575575

576576

577-
dotenv& env = dotenv::instance().load_dotenv();
577+
inline dotenv& env = dotenv::instance().load_dotenv();
578578
}

0 commit comments

Comments
 (0)
Please sign in to comment.