diff --git a/include/libint2/basis.h.in b/include/libint2/basis.h.in index db05f86fa..9c6b10830 100644 --- a/include/libint2/basis.h.in +++ b/include/libint2/basis.h.in @@ -36,7 +36,14 @@ #include #include +#ifdef _MSC_VER +#include +#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) +#define PATH_SEPARATOR "\\" +#else #include +#define PATH_SEPARATOR "/" +#endif #include #include @@ -139,7 +146,7 @@ namespace libint2 { // read in ALL basis set components for(const auto& basis_component_name: basis_component_names) { - auto file_dot_g94 = basis_lib_path + "/" + basis_component_name + ".g94"; + auto file_dot_g94 = basis_lib_path + PATH_SEPARATOR + basis_component_name + ".g94"; // use same cartesian_d convention for all components! component_basis_sets.emplace_back(read_g94_basis_library(file_dot_g94, force_cartesian_d, throw_if_no_match)); @@ -161,7 +168,7 @@ namespace libint2 { } else if (throw_if_no_match) { // not found? throw, if needed std::string errmsg(std::string("did not find the basis for this Z in ") + - basis_lib_path + "/" + basis_component_names[comp_idx] + ".g94"); + basis_lib_path + PATH_SEPARATOR + basis_component_names[comp_idx] + ".g94"); throw std::logic_error(errmsg); } } // basis component loop @@ -411,7 +418,7 @@ namespace libint2 { #endif } // validate basis_path = path + "/basis" - std::string basis_path = path + std::string("/basis"); + std::string basis_path = path + PATH_SEPARATOR + std::string("basis"); bool error = true; std::error_code ec; auto validate_basis_path = [&basis_path, &error, &ec]() -> void {