Skip to content

Commit 60191f9

Browse files
committed
Fix a build error on Windows.
1 parent cd471de commit 60191f9

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
!/source/dependencies/cpu_features
4747
!/source/dependencies/libspng
4848
!/source/dependencies/libspng_cmake
49+
!/source/dependencies/libspng_cmake/CMakeLists.txt
4950
!/source/dependencies/tinygltf
5051
!/source/dependencies/Zisc
5152
!/source/dependencies/Zivc

source/dependencies/libspng_cmake/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ macro(Nanairo_setSpngProject)
3030
source_group(${PROJECT_NAME} FILES ${spng_source_files})
3131
add_library(${PROJECT_NAME} STATIC ${spng_source_files})
3232
#
33-
target_compile_definitions(${PROJECT_NAME} PRIVATE SPNG_STATIC=1
34-
SPNG_DISABLE_OPT=1)
35-
target_link_libraries(${PROJECT_NAME} PRIVATE Zlib::zlib
33+
target_compile_definitions(${PROJECT_NAME} PUBLIC SPNG_STATIC=1
34+
SPNG_DISABLE_OPT=1)
35+
target_link_libraries(${PROJECT_NAME} PUBLIC Zlib::zlib
3636
${math_library})
3737
target_include_directories(${PROJECT_NAME} INTERFACE ${spng_dir})
3838
endmacro(Nanairo_setSpngProject)

source/nanairo/cmd/png_writer.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,10 @@ void PngWriter::write(const LdrImage& image, std::ostream* output) const noexcep
130130
131131
\param [in] no No description.
132132
*/
133-
void PngWriter::checkError(const int no, const std::source_location location) noexcept
133+
void PngWriter::checkError(const int no) noexcept
134134
{
135135
if (no != SPNG_OK) {
136-
std::cerr << " PngWriter error: " << location.file_name() << "("
137-
<< location.line() << ":"
138-
<< location.column() << ") `"
139-
<< location.function_name() << "`: "
140-
<< spng_strerror(no) << std::endl;
136+
std::cerr << " PngWriter error: " << spng_strerror(no) << std::endl;
141137
}
142138
}
143139

source/nanairo/cmd/png_writer.hpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <cstddef>
2020
#include <memory>
2121
#include <ostream>
22-
#include <source_location>
2322
// Zisc
2423
#include "zisc/memory/std_memory_resource.hpp"
2524

@@ -61,8 +60,7 @@ class PngWriter
6160

6261
private:
6362
//! Check if the result has any error
64-
static void checkError(const int no,
65-
const std::source_location location = std::source_location::current()) noexcept;
63+
static void checkError(const int no) noexcept;
6664

6765

6866
spng_ctx* context_ = nullptr;

0 commit comments

Comments
 (0)