Skip to content

Commit

Permalink
Merge pull request #16 from gwint/master
Browse files Browse the repository at this point in the history
Add inline to objects in dotenv.h to prevent multiple definition erro…
  • Loading branch information
adeharo9 committed Jul 30, 2020
2 parents 49f1810 + 3efa9ea commit 453d2a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.10)
project(cpp-dotenv VERSION 0.2.0)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

#----------------------- LIBRARY CONFIGURATION -------------------------
Expand Down
16 changes: 8 additions & 8 deletions dotenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,15 @@ namespace dotenv
};


const container parser::SP
inline const container parser::SP
{
container::CHAR_MODE::INCLUDE,
SP_C,
TB_C
};


const container parser::UNQUOTED_KEY_CHAR
inline const container parser::UNQUOTED_KEY_CHAR
{
container::CHAR_MODE::EXCLUDE,
CS_C,
Expand All @@ -466,7 +466,7 @@ namespace dotenv
};


const container parser::UNQUOTED_VALUE_CHAR
inline const container parser::UNQUOTED_VALUE_CHAR
{
container::CHAR_MODE::EXCLUDE,
CS_C,
Expand All @@ -479,14 +479,14 @@ namespace dotenv
};


const container parser::UNQUOTED_COMMENT_CHAR
inline const container parser::UNQUOTED_COMMENT_CHAR
{
container::CHAR_MODE::EXCLUDE,
NL_C,
CR_C
};

const std::vector<std::pair<char, char>> parser::ESCAPED_EQUIVALENCES
inline const std::vector<std::pair<char, char>> parser::ESCAPED_EQUIVALENCES
{
{ '?' , '?' },
{ '\'', '\'' },
Expand Down Expand Up @@ -570,9 +570,9 @@ namespace dotenv
};


const std::string dotenv::env_filename = ".env";
dotenv dotenv::_instance;
inline const std::string dotenv::env_filename = ".env";
inline dotenv dotenv::_instance;


dotenv& env = dotenv::instance().load_dotenv();
inline dotenv& env = dotenv::instance().load_dotenv();
}

0 comments on commit 453d2a5

Please sign in to comment.