Skip to content

Commit

Permalink
Squashed 'externals/nitro/' changes from 3822f6ef3..d74a68191
Browse files Browse the repository at this point in the history
d74a68191 Merge branch 'main' into cpp17
b12caf2fc latest from CODA-OSS (#556)
0cd432624 use sys::make_span (#555)
f5223165c Merge commit '63bc647787ac53602074aeeedd3565522ea7b170' into cpp17
63bc64778 Squashed 'externals/coda-oss/' changes from d95aa8dd3b..113db4a49d
1ab864800 latest from coda-oss
fc16938bc merge develop/sync_externals
e4b454976 Merge branch 'main' into cpp17
05dae18a3 patch to build other projects

git-subtree-dir: externals/nitro
git-subtree-split: d74a6819149f37d8bbbbfc9f040197e3bcc94e88
  • Loading branch information
Dan Smith authored and Dan Smith committed Jun 13, 2023
1 parent 64a32e4 commit 08481bf
Show file tree
Hide file tree
Showing 38 changed files with 278 additions and 184 deletions.
6 changes: 6 additions & 0 deletions externals/coda-oss/UnitTest/UnitTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -96,6 +97,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -321,6 +323,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\types\unittests\test_complex.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\types\unittests\test_page_row_col.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
Expand Down
3 changes: 3 additions & 0 deletions externals/coda-oss/UnitTest/UnitTest.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@
<ClCompile Include="..\modules\c++\mt\unittests\test_mt_byte_swap.cpp">
<Filter>mt</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\types\unittests\test_complex.cpp">
<Filter>types</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
Expand Down
1 change: 1 addition & 0 deletions externals/coda-oss/UnitTest/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <types/PageRowCol.h>
#include <types/RangeList.h>
#include <types/Range.h>
#include <types/complex.h>
#include <sys/Conf.h>
#include <sys/Path.h>
#include <except/Exception.h>
Expand Down
4 changes: 4 additions & 0 deletions externals/coda-oss/UnitTest/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ TEST_CLASS(test_range_list){ public:
#include "types/unittests/test_range_list.cpp"
};

TEST_CLASS(test_complex){ public:
#include "types/unittests/test_complex.cpp"
};

}
5 changes: 3 additions & 2 deletions externals/coda-oss/modules/c++/coda-oss-lite.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
<ClInclude Include="coda_oss\include\coda_oss\bit.h" />
<ClInclude Include="coda_oss\include\coda_oss\CPlusPlus.h" />
<ClInclude Include="coda_oss\include\coda_oss\cstddef.h" />
<ClInclude Include="coda_oss\include\coda_oss\memory.h" />
<ClInclude Include="coda_oss\include\coda_oss\namespace_.h" />
<ClInclude Include="coda_oss\include\coda_oss\optional.h" />
<ClInclude Include="coda_oss\include\coda_oss\optional_.h" />
<ClInclude Include="coda_oss\include\coda_oss\span.h" />
<ClInclude Include="coda_oss\include\coda_oss\span_.h" />
<ClInclude Include="coda_oss\include\coda_oss\string.h" />
Expand Down Expand Up @@ -257,6 +255,7 @@
<ClInclude Include="tiff\include\tiff\KnownTags.h" />
<ClInclude Include="tiff\include\tiff\TypeFactory.h" />
<ClInclude Include="tiff\include\tiff\Utils.h" />
<ClInclude Include="types\include\types\complex.h" />
<ClInclude Include="types\include\types\PageRowCol.h" />
<ClInclude Include="types\include\types\Range.h" />
<ClInclude Include="types\include\types\RangeList.h" />
Expand Down Expand Up @@ -472,6 +471,7 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnablePREfast>true</EnablePREfast>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>
Expand All @@ -498,6 +498,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>
Expand Down
9 changes: 3 additions & 6 deletions externals/coda-oss/modules/c++/coda-oss-lite.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,12 @@
<ClInclude Include="coda_oss\include\coda_oss\cstddef.h">
<Filter>coda_oss</Filter>
</ClInclude>
<ClInclude Include="coda_oss\include\coda_oss\memory.h">
<Filter>coda_oss</Filter>
</ClInclude>
<ClInclude Include="coda_oss\include\coda_oss\namespace_.h">
<Filter>coda_oss</Filter>
</ClInclude>
<ClInclude Include="coda_oss\include\coda_oss\optional.h">
<Filter>coda_oss</Filter>
</ClInclude>
<ClInclude Include="coda_oss\include\coda_oss\optional_.h">
<Filter>coda_oss</Filter>
</ClInclude>
<ClInclude Include="coda_oss\include\coda_oss\span.h">
<Filter>coda_oss</Filter>
</ClInclude>
Expand Down Expand Up @@ -750,6 +744,9 @@
<ClInclude Include="sys\include\sys\SysInt.h">
<Filter>sys</Filter>
</ClInclude>
<ClInclude Include="types\include\types\complex.h">
<Filter>types</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,15 @@
* License along with this program; If not, http://www.gnu.org/licenses/.
*
*/
#pragma once
#ifndef CODA_OSS_coda_oss_cstddef_h_INCLUDED_
#define CODA_OSS_coda_oss_cstddef_h_INCLUDED_
#pragma once

#include <stdint.h>

#include <cstddef>
#include <type_traits>

// Need a fairly decent C++ compiler to use the real GSL. This brings in more than
// we really need for span (e.g., gsl::narrow()), but it keeps things simple.
#include "gsl/gsl.h" // not gsl/byte; need #pragma here to turn off warnings

namespace coda_oss
{
using byte = std::byte;
}
static_assert(!std::is_same<coda_oss::byte, uint8_t>::value, "'coda_oss::byte' should be a unique type.");

#endif // CODA_OSS_coda_oss_cstddef_h_INCLUDED_
67 changes: 0 additions & 67 deletions externals/coda-oss/modules/c++/coda_oss/include/coda_oss/memory.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

#include <type_traits>

#include "CPlusPlus.h"

#include "coda_oss/namespace_.h"
namespace coda_oss
{
Expand Down
1 change: 0 additions & 1 deletion externals/coda-oss/modules/c++/mem/include/mem/AutoPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include <std/memory>

#include "coda_oss/memory.h"
#include "mem/SharedPtr.h"

namespace mem
Expand Down
20 changes: 12 additions & 8 deletions externals/coda-oss/modules/c++/mem/include/mem/ScopedPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
*
*/

#pragma once
#ifndef CODA_OSS_mem_ScopedPtr_h_INCLUDED_
#define CODA_OSS_mem_ScopedPtr_h_INCLUDED_
#pragma once

#include <assert.h>

#include <cstddef>
#include <std/memory>
Expand Down Expand Up @@ -110,15 +112,13 @@ class ScopedPtr
auto rhs_ptr = rhs.get();
if (ptr == nullptr && rhs_ptr == nullptr)
{
return true;
return true; // both NULL: equal
}

if (ptr == nullptr || rhs_ptr == nullptr)
{
return false;
return false; // either NULL, but not both (above): not equal
}

return *ptr == *rhs_ptr;
return *ptr == *rhs_ptr; // compare the (non-NULL) objects
}

bool operator!=(const ScopedPtr& rhs) const noexcept
Expand All @@ -138,12 +138,16 @@ class ScopedPtr

T& operator*() const
{
return *get();
auto ptr = get();
assert(ptr != nullptr);
return *ptr;
}

T* operator->() const noexcept
{
return get();
auto ptr = get();
assert(ptr != nullptr);
return ptr;
}

void reset(T* ptr = nullptr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
*
*/

#pragma once
#ifndef CODA_OSS_mem_SharedPtrCpp11_h_INCLUDED_
#define CODA_OSS_mem_SharedPtrCpp11_h_INCLUDED_
#pragma once

#include <memory>
#include <type_traits>

#include "coda_oss/memory.h"
#include "sys/CPlusPlus.h"

namespace mem
Expand Down
3 changes: 1 addition & 2 deletions externals/coda-oss/modules/c++/std/include/import/cpp14.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
*
*/


#pragma once
#ifndef CODA_OSS_import_cpp14_h_INCLUDED_
#define CODA_OSS_import_cpp14_h_INCLUDED_
#pragma once

// Common C++14 headers
#include <limits>
Expand Down
5 changes: 2 additions & 3 deletions externals/coda-oss/modules/c++/std/include/std/cstddef
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
* License along with this program; If not, http://www.gnu.org/licenses/.
*
*/
#pragma once
#ifndef CODA_OSS_std_cstddef_INCLUDED_
#define CODA_OSS_std_cstddef_INCLUDED_
#pragma once

#include "coda_oss/CPlusPlus.h"
#include "coda_oss/cstddef.h"
#include <cstddef>

#endif // CODA_OSS_std_cstddef_INCLUDED_
20 changes: 1 addition & 19 deletions externals/coda-oss/modules/c++/std/include/std/memory
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,10 @@
* License along with this program; If not, http://www.gnu.org/licenses/.
*
*/
#pragma once
#ifndef CODA_OSS_std_memory_INCLUDED_
#define CODA_OSS_std_memory_INCLUDED_
#pragma once

#include <memory>
#include "coda_oss/memory.h"
#include "coda_oss/CPlusPlus.h"

// Make it (too?) easy for clients to get our various std:: implementations
#ifndef CODA_OSS_NO_std_make_unique
#if CODA_OSS_cpp14
#define CODA_OSS_NO_std_make_unique 1 // part of C++14
#else
#define CODA_OSS_NO_std_make_unique 0 // use our own
#endif
#endif

#if !CODA_OSS_NO_std_make_unique
namespace std // This is slightly uncouth: we're not supposed to augment "std".
{
using coda_oss::make_unique;
}
#endif // !CODA_OSS_NO_std_make_unique

#endif // CODA_OSS_std_memory_INCLUDED_
5 changes: 2 additions & 3 deletions externals/coda-oss/modules/c++/std/include/std/optional
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
* License along with this program; If not, http://www.gnu.org/licenses/.
*
*/
#pragma once
#ifndef CODA_OSS_std_optional_INCLUDED_
#define CODA_OSS_std_optional_INCLUDED_
#pragma once

#include "coda_oss/CPlusPlus.h"
#include "coda_oss/optional.h"
#include <optional>

#endif // CODA_OSS_std_optional_INCLUDED_
Loading

0 comments on commit 08481bf

Please sign in to comment.