From 8ca6e8dc15502867e5d32e279644f1758724a2f2 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 22 Jun 2022 20:15:43 -0400 Subject: [PATCH] COMP: Fix older gcc build error including "cstddef" for "ptrdiff_t" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes a regression likely introduced in c173dfd80 (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; ^~~~~~~~~ --- Modules/Compatibility/Deprecated/include/itkAtomicInt.h | 1 + Modules/Core/Common/include/itkIndex.h | 2 ++ Modules/Core/Common/include/itkOffset.h | 2 ++ Modules/Core/Common/include/itkSize.h | 1 + Modules/IO/ImageBase/include/itkImageSeriesReader.hxx | 1 + 5 files changed, 7 insertions(+) diff --git a/Modules/Compatibility/Deprecated/include/itkAtomicInt.h b/Modules/Compatibility/Deprecated/include/itkAtomicInt.h index d587551715d3..bc1770d4decf 100644 --- a/Modules/Compatibility/Deprecated/include/itkAtomicInt.h +++ b/Modules/Compatibility/Deprecated/include/itkAtomicInt.h @@ -39,6 +39,7 @@ #include "itkConceptChecking.h" #include +#include // For ptrdiff_t. namespace itk diff --git a/Modules/Core/Common/include/itkIndex.h b/Modules/Core/Common/include/itkIndex.h index 0daa838d3c07..b5c1c75f9cac 100644 --- a/Modules/Core/Common/include/itkIndex.h +++ b/Modules/Core/Common/include/itkIndex.h @@ -20,6 +20,8 @@ #include "itkMakeFilled.h" #include "itkOffset.h" + +#include // For ptrdiff_t. #include // For is_integral. namespace itk diff --git a/Modules/Core/Common/include/itkOffset.h b/Modules/Core/Common/include/itkOffset.h index e0e55f8c2dd6..b2da9349743f 100644 --- a/Modules/Core/Common/include/itkOffset.h +++ b/Modules/Core/Common/include/itkOffset.h @@ -21,6 +21,8 @@ #include "itkSize.h" #include "itkMath.h" +#include // For ptrdiff_t. + namespace itk { diff --git a/Modules/Core/Common/include/itkSize.h b/Modules/Core/Common/include/itkSize.h index 55bdc508b48f..3dda87717db4 100644 --- a/Modules/Core/Common/include/itkSize.h +++ b/Modules/Core/Common/include/itkSize.h @@ -22,6 +22,7 @@ #include "itkMacro.h" #include "itkMakeFilled.h" #include // For copy_n. +#include // For ptrdiff_t. #include // For is_integral. #include diff --git a/Modules/IO/ImageBase/include/itkImageSeriesReader.hxx b/Modules/IO/ImageBase/include/itkImageSeriesReader.hxx index c1b78f24c8d5..bea2d4d2b926 100644 --- a/Modules/IO/ImageBase/include/itkImageSeriesReader.hxx +++ b/Modules/IO/ImageBase/include/itkImageSeriesReader.hxx @@ -25,6 +25,7 @@ #include "itkMath.h" #include "itkProgressReporter.h" #include "itkMetaDataObject.h" +#include // For ptrdiff_t. #include namespace itk