Skip to content

Commit 0363ffe

Browse files
author
Gregory
committed
Add inline to objects in dotenv.h to prevent multiple definition errors during linking
1 parent 49f1810 commit 0363ffe

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

dotenv.h

Lines changed: 8 additions & 8 deletions
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)