Skip to content

Commit

Permalink
COMP: Fix older gcc build error including "cstddef" for "ptrdiff_t"
Browse files Browse the repository at this point in the history
This commit fixes a regression likely introduced in c173dfd (STYLE: Remove
`std::` prefix from types that work without it) to support building ITK
wheels using manylinux_2_24 providing gcc 6.3.

It fixes build error like the following:

  In file included from /work/ITK-source/ITK/Modules/Core/Common/include/itkImageRegion.h:33:0,
                   from /work/ITK-source/ITK/Modules/Core/Common/include/itkMultiThreaderBase.h:35,
                   from /work/ITK-source/ITK/Modules/Core/Common/src/itkTotalProgressReporter.cxx:19:
  /work/ITK-source/ITK/Modules/Core/Common/include/itkSize.h:242:27: error: ‘ptrdiff_t’ does not name a type
     using difference_type = ptrdiff_t;
                             ^~~~~~~~~
  • Loading branch information
jcfr authored and thewtex committed Jun 23, 2022
1 parent e27a8a7 commit 0563258
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Modules/Compatibility/Deprecated/include/itkAtomicInt.h
Expand Up @@ -39,6 +39,7 @@
#include "itkConceptChecking.h"

#include <atomic>
#include <cstddef> // For ptrdiff_t.


namespace itk
Expand Down
2 changes: 2 additions & 0 deletions Modules/Core/Common/include/itkIndex.h
Expand Up @@ -20,6 +20,8 @@

#include "itkMakeFilled.h"
#include "itkOffset.h"

#include <cstddef> // For ptrdiff_t.
#include <type_traits> // For is_integral.

namespace itk
Expand Down
2 changes: 2 additions & 0 deletions Modules/Core/Common/include/itkOffset.h
Expand Up @@ -21,6 +21,8 @@
#include "itkSize.h"
#include "itkMath.h"

#include <cstddef> // For ptrdiff_t.

namespace itk
{

Expand Down
1 change: 1 addition & 0 deletions Modules/Core/Common/include/itkSize.h
Expand Up @@ -22,6 +22,7 @@
#include "itkMacro.h"
#include "itkMakeFilled.h"
#include <algorithm> // For copy_n.
#include <cstddef> // For ptrdiff_t.
#include <type_traits> // For is_integral.
#include <memory>

Expand Down
1 change: 1 addition & 0 deletions Modules/IO/ImageBase/include/itkImageSeriesReader.hxx
Expand Up @@ -25,6 +25,7 @@
#include "itkMath.h"
#include "itkProgressReporter.h"
#include "itkMetaDataObject.h"
#include <cstddef> // For ptrdiff_t.
#include <iomanip>

namespace itk
Expand Down

0 comments on commit 0563258

Please sign in to comment.