Skip to content

Commit

Permalink
Source/Common/Platform: Explicitly include <cstdint>
Browse files Browse the repository at this point in the history
GCC 15 will no longer include <cstdint> by default, resulting in build
failures in projects that do not explicitly include it.

Errors:

Source/Common/Platform/NMR_EncryptionHeader.cpp:
In member function ‘size_t NMR::CEncryptionHeader::readFrom(NMR::PImportStream)’:
Source/Common/Platform/NMR_EncryptionHeader.cpp:35:52:
error: ‘uint64_t’ was not declared in this scope
   35 |                 if (header.Header.Length.length < (uint64_t) headerSize)
      |                                                    ^~~~~~~~
Source/Common/Platform/NMR_EncryptionHeader.cpp:12:1:
note: ‘uint64_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   11 | #include <cstring>
  +++ |+#include <cstdint>
   12 |

Source/Common/Platform/NMR_ImportStream_Unique_Memory.cpp:
In member function ‘virtual const NMR::nfByte* NMR::CImportStream_Unique_Memory::getAt(NMR::nfUint64)’:
Source/Common/Platform/NMR_ImportStream_Unique_Memory.cpp:128:35:
error: ‘uint64_t’ was not declared in this scope
  128 |                 if (nPosition >= (uint64_t) m_Buffer.size())
      |                                   ^~~~~~~~
Source/Common/Platform/NMR_ImportStream_Unique_Memory.cpp:37:1:
note: ‘uint64_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   36 | #include "Common/NMR_Exception_Windows.h"
  +++ |+#include <cstdint>
   37 |

Test results:

Test project lib3mf/build
    Start 1: Test_CPP_Bindings
1/1 Test #1: Test_CPP_Bindings ................   Passed    0.39 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.39 sec

Gentoo bug: https://bugs.gentoo.org/937423
See-also: https://gcc.gnu.org/pipermail/gcc-cvs/2024-August/407124.html
Signed-off-by: Christopher Fore <[email protected]>
  • Loading branch information
csfore committed Aug 9, 2024
1 parent 5746aa3 commit 39d5c7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/Common/Platform/NMR_EncryptionHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "Common/Platform/NMR_ExportStream.h"

#include "Common/NMR_Architecture_Utils.h"
#include <cstdint>
#include <cstring>

#define LIB3MF_MAXENCRYPTIONHEADERSIZE (1UL << 31)
Expand Down
2 changes: 2 additions & 0 deletions Source/Common/Platform/NMR_ImportStream_Unique_Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ This is a platform independent class for keeping data in a memory stream that ow
#include "Common/NMR_Exception.h"
#include "Common/NMR_Exception_Windows.h"

#include <cstdint>

namespace NMR {

CImportStream_Unique_Memory::CImportStream_Unique_Memory()
Expand Down

0 comments on commit 39d5c7f

Please sign in to comment.