Skip to content

Commit

Permalink
Squashed 'externals/coda-oss/' changes from f1ad69fd4..df07c512d
Browse files Browse the repository at this point in the history
df07c512d Merge branch 'main' into cpp17
4c68fa0d3 fix directory names
dc825aa9f Merge branch 'main' into cpp17
5ee2f039a poor-man's version of "import module std;" (#655)
fad02842c Add HighFive library (#654)
b31f5b6ab have Python 3.6 on a build server

git-subtree-dir: externals/coda-oss
git-subtree-split: df07c512d4fab0626594d98f2fe99f2f2f2e5616
  • Loading branch information
Dan Smith authored and Dan Smith committed Feb 20, 2023
1 parent 0cc8943 commit a623088
Show file tree
Hide file tree
Showing 206 changed files with 31,526 additions and 46 deletions.
25 changes: 3 additions & 22 deletions UnitTest/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,15 @@
#include <math.h>
#include <assert.h>

#include <typeinfo>
#include <locale>
#include <limits>
#include <iterator>
#include <array>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <fstream>
#include <sstream>
#include "import/std.h"

#include <std/string>
#include <std/span>
#include <std/optional>
#include <std/cstddef>
#include <std/bit>
#include <algorithm>
#include <std/bit> // std::endian
#include <std/cstddef>
#include <numeric> // std::accumulate
#include <std/filesystem>
#include <future>
#include <cassert>
#include <tuple>
#include <complex>
#include <stdexcept>
#include <std/bit> // std::endian

#include "CppUnitTest.h"

Expand Down
4 changes: 2 additions & 2 deletions build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
for ext in COMMON_EXCLUDES_EXT:
TaskGen.extension(ext)(Utils.nada)

if sys.version_info < (3,7,0):
raise Errors.WafError('Build system requires at least Python 3.7')
if sys.version_info < (3,6,0):
raise Errors.WafError('Build system requires at least Python 3.6')

# provide a partial function if we don't have one
try:
Expand Down
4 changes: 4 additions & 0 deletions modules/c++/coda-oss-lite.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<ClInclude Include="coda_oss\include\coda_oss\string.h" />
<ClInclude Include="coda_oss\include\coda_oss\type_traits.h" />
<ClInclude Include="config\include\config\compiler_extensions.h" />
<ClInclude Include="config\include\config\disable_compiler_warnings.h" />
<ClInclude Include="config\include\config\Exports.h" />
<ClInclude Include="config\include\config\Version.h" />
<ClInclude Include="except\include\except\Backtrace.h" />
Expand Down Expand Up @@ -175,6 +176,9 @@
<ClInclude Include="sio.lite\include\sio\lite\StreamReader.h" />
<ClInclude Include="sio.lite\include\sio\lite\UnsupportedDataTypeException.h" />
<ClInclude Include="sio.lite\include\sio\lite\UserDataDictionary.h" />
<ClInclude Include="std\include\import\cpp14.h" />
<ClInclude Include="std\include\import\cpp17.h" />
<ClInclude Include="std\include\import\std.h" />
<ClInclude Include="str\include\str\Convert.h" />
<ClInclude Include="str\include\str\EncodedString.h" />
<ClInclude Include="str\include\str\EncodedStringView.h" />
Expand Down
12 changes: 12 additions & 0 deletions modules/c++/coda-oss-lite.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,18 @@
<ClInclude Include="mem\include\mem\ComplexView.h">
<Filter>mem</Filter>
</ClInclude>
<ClInclude Include="std\include\import\cpp14.h">
<Filter>std</Filter>
</ClInclude>
<ClInclude Include="std\include\import\cpp17.h">
<Filter>std</Filter>
</ClInclude>
<ClInclude Include="std\include\import\std.h">
<Filter>std</Filter>
</ClInclude>
<ClInclude Include="config\include\config\disable_compiler_warnings.h">
<Filter>config</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
Expand Down
2 changes: 2 additions & 0 deletions modules/c++/include/TestCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ inline void specific_exception(TFunc f,
diePrintf(format, testName, file, func, line);
}
catch (const TException&) { }
#if !CODA_OSS_except_Throwable_ISA_std_exception
catch (const except::Throwable&)
{
diePrintf(format, testName, file, func, line);
}
#endif
catch (const std::exception&)
{
diePrintf(format, testName, file, func, line);
Expand Down
22 changes: 1 addition & 21 deletions modules/c++/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,7 @@
#include <stdint.h>
#include <time.h>

#include <limits>
#include <complex>
#include <memory>
#include <new>
#include <utility>
#include <type_traits>
#include <typeinfo>
#include <array>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <iomanip>
#include <iostream>
#include <ostream>
#include <sstream>
#include <future>
#include <functional>
#include "import/std.h"
#include <std/span>
#include <std/string>
#include <std/filesystem>
Expand Down
61 changes: 61 additions & 0 deletions modules/c++/std/include/import/cpp14.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/* =========================================================================
* This file is part of std-c++
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
* (C) Copyright 2023, Maxar Technologies, Inc.
*
* std-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; If not,
* see <http://www.gnu.org/licenses/>.
*
*/


#ifndef CODA_OSS_import_cpp14_h_INCLUDED_
#define CODA_OSS_import_cpp14_h_INCLUDED_
#pragma once

// Common C++14 headers
#include <limits>
#include <memory>
#include <new>

#include <complex>
#include <utility>
#include <tuple>
#include <future>
#include <typeinfo>
#include <type_traits>
#include <stdexcept>
#include <locale>

#include <iomanip>
#include <iostream>
#include <ostream>
#include <sstream>

#include <array>
#include <string>
#include <vector>
#include <map>
#include <set>

#include <numeric>
#include <functional>
#include <algorithm>
#include <iterator>

#endif // CODA_OSS_import_cpp14_h_INCLUDED_


36 changes: 36 additions & 0 deletions modules/c++/std/include/import/cpp17.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* =========================================================================
* This file is part of std-c++
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
* (C) Copyright 2023, Maxar Technologies, Inc.
*
* std-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; If not,
* see <http://www.gnu.org/licenses/>.
*
*/

#ifndef CODA_OSS_import_cpp17_h_INCLUDED_
#define CODA_OSS_import_cpp17_h_INCLUDED_
#pragma once

#include "cpp14.h"

// Common C++17 headers
#include <filesystem>
#include <optional>

#endif // CODA_OSS_import_cpp17_h_INCLUDED_


58 changes: 58 additions & 0 deletions modules/c++/std/include/import/std.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* =========================================================================
* This file is part of std-c++
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
* (C) Copyright 2023, Maxar Technologies, Inc.
*
* std-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; If not,
* see <http://www.gnu.org/licenses/>.
*
*/


#ifndef CODA_OSS_import_std_h_INCLUDED_
#define CODA_OSS_import_std_h_INCLUDED_
#pragma once

#include "coda_oss/CPlusPlus.h"
#include "config/disable_compiler_warnings.h"

CODA_OSS_disable_warning_push
#if _MSC_VER
#pragma warning(disable: 4619) // #pragma warning: there is no warning number '...'

#pragma warning(disable: 4710) // '...': function not inlined
#pragma warning(disable: 5027) // '...': move assignment operator was implicitly defined as deleted
#pragma warning(disable: 5026) // '...': move constructor was implicitly defined as deleted
#pragma warning(disable: 4626) // '...': assignment operator was implicitly defined as deleted
#pragma warning(disable: 4625) // '...': copy constructor was implicitly defined as deleted
#pragma warning(disable: 4355) // '...': used in base member initializer list
#pragma warning(disable: 5220) // '...': a non-static data member with a volatile qualified type no longer implies that compiler generated copy/move constructors and copy/move assignment operators are not trivial
#pragma warning(disable: 5204) // '...': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly
#pragma warning(disable: 5264) // '...': '...' variable is not used
#endif // _MSC_VER

// Common C++14 headers
#include "cpp14.h"

#if CODA_OSS_cpp17
#include "cpp17.h"
#endif

CODA_OSS_disable_warning_pop

#endif // CODA_OSS_import_std_h_INCLUDED_


1 change: 1 addition & 0 deletions modules/drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ set(CODA_ENABLE_HDF5 ON CACHE BOOL "enable hdf5")
set(CODA_HDF5_HOME "" CACHE PATH "path to pre-existing HDF5 installation, if not provided HDF5 will be built")
if (CODA_ENABLE_HDF5 OR CODA_HDF5_HOME)
add_subdirectory("hdf5")
add_subdirectory("highfive")
endif()
4 changes: 3 additions & 1 deletion modules/drivers/hdf5/source/H5MM.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@ H5MM_memcpy(void *dest, const void *src, size_t n)
HDassert(src);

/* Check for buffer overlap */
HDassert((char *)dest >= (const char *)src + n || (const char *)src >= (char *)dest + n);
const char* src_n = (const char*)src + n;
const char* dest_n = (const char*)dest + n;
HDassert((const char *)dest >= src_n || (const char *)src >= dest_n);

/* Copy */
ret = HDmemcpy(dest, src, n);
Expand Down
19 changes: 19 additions & 0 deletions modules/drivers/highfive/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
set(MODULE_NAME highfive)
set(TARGET_LANGUAGE c++)

if(CODA_ENABLE_HDF5)
set(MODULE_DEPS config-c++ sys-c++)
list(APPEND MODULE_DEPS hdf5-c++)

coda_add_module(
${MODULE_NAME}
VERSION 2.6.2
DEPS ${MODULE_DEPS})

coda_add_tests(
MODULE_NAME ${MODULE_NAME}
DIRECTORY "unittests"
UNITTEST)
else()
message("${MODULE_NAME} will not be built since HDF5 is not enabled")
endif()
Binary file added modules/drivers/highfive/HighFive-2.6.2.zip
Binary file not shown.
Loading

0 comments on commit a623088

Please sign in to comment.