Skip to content

Commit 953c677

Browse files
authored
Merge pull request #601 from diffblue/filesystem_path
use std::filesystem::path instead of std::string
2 parents 61e797f + 3dcc3e8 commit 953c677

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/verilog/verilog_preprocessor.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Author: Daniel Kroening, kroening@kroening.com
99
#include "verilog_preprocessor.h"
1010

1111
#include <util/config.h>
12-
#include <util/unicode.h>
1312

1413
#include "verilog_preprocessor_error.h"
1514

@@ -98,7 +97,7 @@ Function: verilog_preprocessort::include
9897
9998
\*******************************************************************/
10099

101-
std::string verilog_preprocessort::find_include_file(
100+
std::filesystem::path verilog_preprocessort::find_include_file(
102101
const std::string &including_file,
103102
const std::string &given_filename,
104103
bool include_paths_only)
@@ -555,11 +554,7 @@ void verilog_preprocessort::directive()
555554
auto full_path =
556555
find_include_file(context().filename, given_filename, include_paths_only);
557556

558-
#ifdef _MSC_VER
559-
auto in = new std::ifstream(widen(full_path));
560-
#else
561557
auto in = new std::ifstream(full_path);
562-
#endif
563558

564559
if(!*in)
565560
throw verilog_preprocessor_errort() << "failed to open an include file";

src/verilog/verilog_preprocessor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "verilog_preprocessor_tokenizer.h"
1010

11+
#include <filesystem>
1112
#include <list>
1213
#include <map>
1314

@@ -44,7 +45,7 @@ class verilog_preprocessort:public preprocessort
4445
definest defines;
4546

4647
void directive();
47-
std::string find_include_file(
48+
std::filesystem::path find_include_file(
4849
const std::string &including_file,
4950
const std::string &given_filename,
5051
bool include_paths_only);

0 commit comments

Comments
 (0)