Skip to content

Commit

Permalink
Fix errors when building preprocessor with other compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
crosire committed Dec 8, 2019
1 parent 5b3eb1e commit a5de7b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/effect_expression.hpp
Expand Up @@ -299,8 +299,8 @@ namespace reshadefx
texture_address_mode address_u = texture_address_mode::clamp;
texture_address_mode address_v = texture_address_mode::clamp;
texture_address_mode address_w = texture_address_mode::clamp;
float min_lod = -FLT_MAX;
float max_lod = +FLT_MAX;
float min_lod = -3.402823466e+38f; // FLT_MAX
float max_lod = +3.402823466e+38f;
float lod_bias = 0.0f;
uint8_t srgb = false;
};
Expand Down
6 changes: 6 additions & 0 deletions source/effect_preprocessor.cpp
Expand Up @@ -19,9 +19,15 @@ enum macro_replacement

static bool read_file(const std::filesystem::path &path, std::string &data)
{
#ifdef _WIN32
FILE *file = nullptr;
if (_wfopen_s(&file, path.c_str(), L"rb") != 0)
return false;
#else
FILE *const file = fopen(path.c_str(), "rb");
if (file == nullptr)
return false;
#endif

// Read file contents into memory
std::vector<char> mem(static_cast<size_t>(std::filesystem::file_size(path) + 1));
Expand Down

0 comments on commit a5de7b9

Please sign in to comment.