Skip to content

Commit b3de92e

Browse files
committed
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys: KWSys 2024-11-23 (3e9b0b88)
2 parents 15d25a4 + cc7d2db commit b3de92e

16 files changed

+322
-505
lines changed

thirdparty/KWSys/adios2sys/CMakeLists.txt

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,6 @@ endif()
298298
set(KWSYS_HEADER_INSTALL_DIR)
299299
set(KWSYS_LIBRARY_INSTALL_DIR)
300300

301-
# Generated source files will need this header.
302-
string(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}"
303-
KWSYS_IN_SOURCE_BUILD)
304-
if(NOT KWSYS_IN_SOURCE_BUILD)
305-
configure_file(${PROJECT_SOURCE_DIR}/kwsysPrivate.h
306-
${PROJECT_BINARY_DIR}/kwsysPrivate.h COPYONLY IMMEDIATE)
307-
endif()
308-
309301
# Select plugin module file name convention.
310302
if(NOT KWSYS_DynamicLoader_PREFIX)
311303
set(KWSYS_DynamicLoader_PREFIX ${CMAKE_SHARED_MODULE_PREFIX})
@@ -418,14 +410,6 @@ if(KWSYS_USE_DynamicLoader)
418410
endif()
419411

420412
if(KWSYS_USE_SystemTools)
421-
if (NOT DEFINED KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP)
422-
set(KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP 1)
423-
endif ()
424-
if (KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP)
425-
set(KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP 1)
426-
else ()
427-
set(KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP 0)
428-
endif ()
429413
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_SETENV
430414
"Checking whether CXX compiler has setenv" DIRECT)
431415
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UNSETENV
@@ -634,7 +618,7 @@ set(cppclasses
634618
Directory DynamicLoader Encoding Glob RegularExpression SystemTools
635619
CommandLineArguments FStream SystemInformation ConsoleBuf Status
636620
)
637-
foreach(cpp ${cppclasses})
621+
foreach(cpp IN LISTS cppclasses)
638622
if(KWSYS_USE_${cpp})
639623
# Use the corresponding class.
640624
set(KWSYS_CLASSES ${KWSYS_CLASSES} ${cpp})
@@ -647,7 +631,7 @@ foreach(cpp ${cppclasses})
647631
endforeach()
648632

649633
# Add selected C components.
650-
foreach(c
634+
foreach(c IN ITEMS
651635
Process Base64 Encoding MD5 Terminal System String
652636
)
653637
if(KWSYS_USE_${c})
@@ -679,7 +663,7 @@ if(KWSYS_USE_Process)
679663
endif()
680664

681665
# Add selected C sources.
682-
foreach(c Base64 Encoding MD5 Terminal System String)
666+
foreach(c IN ITEMS Base64 Encoding MD5 Terminal System String)
683667
if(KWSYS_USE_${c})
684668
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${c}C.c)
685669
list(APPEND KWSYS_C_SRCS ${c}C.c)
@@ -690,7 +674,7 @@ foreach(c Base64 Encoding MD5 Terminal System String)
690674
endforeach()
691675

692676
# Configure headers of C++ classes and construct the list of sources.
693-
foreach(c ${KWSYS_CLASSES})
677+
foreach(c IN LISTS KWSYS_CLASSES)
694678
# Add this source to the list of source files for the library.
695679
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${c}CXX.cxx)
696680
list(APPEND KWSYS_CXX_SRCS ${c}CXX.cxx)
@@ -712,7 +696,7 @@ foreach(c ${KWSYS_CLASSES})
712696
endforeach()
713697

714698
# Configure C headers.
715-
foreach(h ${KWSYS_H_FILES})
699+
foreach(h IN LISTS KWSYS_H_FILES)
716700
# Configure the header into the given directory.
717701
configure_file(${PROJECT_SOURCE_DIR}/${h}.h.in ${KWSYS_HEADER_DIR}/${h}.h
718702
@ONLY IMMEDIATE)
@@ -727,7 +711,7 @@ foreach(h ${KWSYS_H_FILES})
727711
endforeach()
728712

729713
# Configure other C++ headers.
730-
foreach(h ${KWSYS_HXX_FILES})
714+
foreach(h IN LISTS KWSYS_HXX_FILES)
731715
# Configure the header into the given directory.
732716
configure_file(${PROJECT_SOURCE_DIR}/${h}.hxx.in ${KWSYS_HEADER_DIR}/${h}.hxx
733717
@ONLY IMMEDIATE)
@@ -956,9 +940,11 @@ if(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
956940
add_executable(${KWSYS_NAMESPACE}TestsC ${KWSYS_C_TEST_SRCS})
957941
set_property(TARGET ${KWSYS_NAMESPACE}TestsC PROPERTY LABELS ${KWSYS_LABELS_EXE})
958942
target_link_libraries(${KWSYS_NAMESPACE}TestsC ${KWSYS_TARGET_C_LINK})
959-
foreach(testfile ${KWSYS_C_TESTS})
943+
foreach(testfile IN LISTS KWSYS_C_TESTS)
960944
get_filename_component(test "${testfile}" NAME_WE)
961-
add_test(kwsys.${test} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsC ${test} ${KWSYS_TEST_ARGS_${test}})
945+
add_test(NAME kwsys.${test}
946+
COMMAND ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsC ${test} ${KWSYS_TEST_ARGS_${test}}
947+
)
962948
set_property(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST})
963949
endforeach()
964950

@@ -1080,9 +1066,11 @@ if(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
10801066
-p
10811067
some junk at the end
10821068
)
1083-
foreach(testfile ${KWSYS_CXX_TESTS})
1069+
foreach(testfile IN LISTS KWSYS_CXX_TESTS)
10841070
get_filename_component(test "${testfile}" NAME_WE)
1085-
add_test(kwsys.${test} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsCxx ${test} ${KWSYS_TEST_ARGS_${test}})
1071+
add_test(NAME kwsys.${test}
1072+
COMMAND ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsCxx ${test} ${KWSYS_TEST_ARGS_${test}}
1073+
)
10861074
set_property(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST})
10871075
endforeach()
10881076

@@ -1091,10 +1079,12 @@ if(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
10911079
set_property(TARGET ${KWSYS_NAMESPACE}TestProcess PROPERTY LABELS ${KWSYS_LABELS_EXE})
10921080
target_link_libraries(${KWSYS_NAMESPACE}TestProcess ${KWSYS_TARGET_C_LINK})
10931081
#set(KWSYS_TEST_PROCESS_7 7) # uncomment to run timing-sensitive test locally
1094-
foreach(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7} 9 10)
1095-
add_test(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n})
1082+
foreach(n IN ITEMS 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7} 9 10)
1083+
add_test(NAME kwsys.testProcess-${n}
1084+
COMMAND ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n}
1085+
)
10961086
set_property(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST})
1097-
set_tests_properties(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120)
1087+
set_property(TEST kwsys.testProcess-${n} PROPERTY TIMEOUT 120)
10981088
endforeach()
10991089

11001090
set(testProcess_COMPILE_FLAGS "")
@@ -1121,9 +1111,9 @@ if(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
11211111
# Configure some test properties.
11221112
if(KWSYS_STANDALONE)
11231113
# We expect test to fail
1124-
set_tests_properties(kwsys.testFail PROPERTIES WILL_FAIL ON)
1114+
set_property(TEST kwsys.testFail PROPERTY WILL_FAIL ON)
11251115
get_test_property(kwsys.testFail WILL_FAIL wfv)
1126-
set_tests_properties(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value")
1116+
set_property(TEST kwsys.testFail PROPERTY MEASUREMENT "Some Key=Some Value")
11271117
message(STATUS "GET_TEST_PROPERTY returned: ${wfv}")
11281118
endif()
11291119

@@ -1133,7 +1123,7 @@ if(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
11331123

11341124
# Suppress known consistent failures on buggy systems.
11351125
if(KWSYS_TEST_BOGUS_FAILURES)
1136-
set_tests_properties(${KWSYS_TEST_BOGUS_FAILURES} PROPERTIES WILL_FAIL ON)
1126+
set_property(TEST ${KWSYS_TEST_BOGUS_FAILURES} PROPERTY WILL_FAIL ON)
11371127
endif()
11381128

11391129
endif()

thirdparty/KWSys/adios2sys/CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ code. It automatically runs ``clang-format`` on the set of source files
3434
for which we enforce style. The script also has options to format only
3535
a subset of files, such as those that are locally modified.
3636

37-
.. _`clang-format`: http://clang.llvm.org/docs/ClangFormat.html
37+
.. _`clang-format`: https://clang.llvm.org/docs/ClangFormat.html
3838
.. _`.clang-format`: .clang-format
3939
.. _`clang-format.bash`: clang-format.bash
4040

thirdparty/KWSys/adios2sys/CommandLineArguments.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ bool CommandLineArguments::GetMatchedArguments(
132132

133133
// Does the argument match to any we know about?
134134
for (it = this->Internals->Callbacks.begin();
135-
it != this->Internals->Callbacks.end(); it++) {
135+
it != this->Internals->Callbacks.end(); ++it) {
136136
const CommandLineArguments::Internal::String& parg = it->first;
137137
CommandLineArgumentsCallbackStructure* cs = &it->second;
138138
if (cs->ArgumentType == CommandLineArguments::NO_ARGUMENT ||
@@ -467,7 +467,7 @@ void CommandLineArguments::GenerateHelp()
467467
MapArgs mp;
468468
MapArgs::iterator mpit, smpit;
469469
for (it = this->Internals->Callbacks.begin();
470-
it != this->Internals->Callbacks.end(); it++) {
470+
it != this->Internals->Callbacks.end(); ++it) {
471471
CommandLineArgumentsCallbackStructure* cs = &(it->second);
472472
mpit = mp.find(cs->Help);
473473
if (mpit != mp.end()) {
@@ -478,14 +478,14 @@ void CommandLineArguments::GenerateHelp()
478478
}
479479
}
480480
for (it = this->Internals->Callbacks.begin();
481-
it != this->Internals->Callbacks.end(); it++) {
481+
it != this->Internals->Callbacks.end(); ++it) {
482482
CommandLineArgumentsCallbackStructure* cs = &(it->second);
483483
mpit = mp.find(cs->Help);
484484
if (mpit != mp.end()) {
485485
mpit->second.insert(it->first);
486486
smpit = mp.find(it->first);
487487
CommandLineArguments::Internal::SetOfStrings::iterator sit;
488-
for (sit = smpit->second.begin(); sit != smpit->second.end(); sit++) {
488+
for (sit = smpit->second.begin(); sit != smpit->second.end(); ++sit) {
489489
mpit->second.insert(*sit);
490490
}
491491
mp.erase(smpit);
@@ -496,9 +496,9 @@ void CommandLineArguments::GenerateHelp()
496496

497497
// Find the length of the longest string
498498
CommandLineArguments::Internal::String::size_type maxlen = 0;
499-
for (mpit = mp.begin(); mpit != mp.end(); mpit++) {
499+
for (mpit = mp.begin(); mpit != mp.end(); ++mpit) {
500500
CommandLineArguments::Internal::SetOfStrings::iterator sit;
501-
for (sit = mpit->second.begin(); sit != mpit->second.end(); sit++) {
501+
for (sit = mpit->second.begin(); sit != mpit->second.end(); ++sit) {
502502
CommandLineArguments::Internal::String::size_type clen = sit->size();
503503
switch (this->Internals->Callbacks[*sit].ArgumentType) {
504504
case CommandLineArguments::NO_ARGUMENT:
@@ -524,9 +524,9 @@ void CommandLineArguments::GenerateHelp()
524524
maxlen += 4; // For the space before and after the option
525525

526526
// Print help for each option
527-
for (mpit = mp.begin(); mpit != mp.end(); mpit++) {
527+
for (mpit = mp.begin(); mpit != mp.end(); ++mpit) {
528528
CommandLineArguments::Internal::SetOfStrings::iterator sit;
529-
for (sit = mpit->second.begin(); sit != mpit->second.end(); sit++) {
529+
for (sit = mpit->second.begin(); sit != mpit->second.end(); ++sit) {
530530
str << std::endl;
531531
std::string argument = *sit;
532532
switch (this->Internals->Callbacks[*sit].ArgumentType) {

thirdparty/KWSys/adios2sys/Configure.hxx.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
/* Whether <ext/stdio_filebuf.h> is available. */
1212
#define @KWSYS_NAMESPACE@_CXX_HAS_EXT_STDIO_FILEBUF_H \
1313
@KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H@
14-
/* Whether the translation map is available or not. */
15-
#define @KWSYS_NAMESPACE@_SYSTEMTOOLS_USE_TRANSLATION_MAP \
16-
@KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP@
1714

1815
#if defined(__SUNPRO_CC) && __SUNPRO_CC > 0x5130 && defined(__has_attribute)
1916
# define @KWSYS_NAMESPACE@_has_cpp_attribute(x) __has_attribute(x)
@@ -58,8 +55,6 @@
5855
# define KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H \
5956
@KWSYS_NAMESPACE@_CXX_HAS_EXT_STDIO_FILEBUF_H
6057
# define KWSYS_FALLTHROUGH @KWSYS_NAMESPACE@_FALLTHROUGH
61-
# define KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP \
62-
@KWSYS_NAMESPACE@_SYSTEMTOOLS_USE_TRANSLATION_MAP
6358
#endif
6459

6560
#endif

thirdparty/KWSys/adios2sys/Directory.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name,
269269
# include <string.h>
270270

271271
// PGI with glibc has trouble with dirent and large file support:
272-
// http://www.pgroup.com/userforum/viewtopic.php?
272+
// https://www.pgroup.com/userforum/viewtopic.php?
273273
// p=1992&sid=f16167f51964f1a68fe5041b8eb213b6
274274
// Work around the problem by mapping dirent the same way as readdir.
275275
# if defined(__PGI) && defined(__GLIBC__)
@@ -292,7 +292,7 @@ Status Directory::Load(std::string const& name, std::string* errorMessage)
292292
DIR* dir = opendir(name.c_str());
293293

294294
if (!dir) {
295-
if (errorMessage != nullptr) {
295+
if (errorMessage) {
296296
*errorMessage = std::string(strerror(errno));
297297
}
298298
return Status::POSIX_errno();
@@ -303,7 +303,7 @@ Status Directory::Load(std::string const& name, std::string* errorMessage)
303303
this->Internal->Files.emplace_back(d->d_name);
304304
}
305305
if (errno != 0) {
306-
if (errorMessage != nullptr) {
306+
if (errorMessage) {
307307
*errorMessage = std::string(strerror(errno));
308308
}
309309
return Status::POSIX_errno();
@@ -321,7 +321,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name,
321321
DIR* dir = opendir(name.c_str());
322322

323323
if (!dir) {
324-
if (errorMessage != nullptr) {
324+
if (errorMessage) {
325325
*errorMessage = std::string(strerror(errno));
326326
}
327327
return 0;
@@ -332,7 +332,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name,
332332
count++;
333333
}
334334
if (errno != 0) {
335-
if (errorMessage != nullptr) {
335+
if (errorMessage) {
336336
*errorMessage = std::string(strerror(errno));
337337
}
338338
return false;

thirdparty/KWSys/adios2sys/MD5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
5353
This code implements the MD5 Algorithm defined in RFC 1321, whose
5454
text is available at
55-
http://www.ietf.org/rfc/rfc1321.txt
55+
https://www.ietf.org/rfc/rfc1321.txt
5656
The code is derived from the text of the RFC, including the test suite
5757
(section A.5) but excluding the rest of Appendix A. It does not include
5858
any code or documentation that is identified in the RFC as being

thirdparty/KWSys/adios2sys/ProcessUNIX.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2541,7 +2541,7 @@ static void kwsysProcessKill(pid_t process_id)
25412541
/* Kill all children if we can find them. */
25422542
#if defined(__linux__) || defined(__CYGWIN__)
25432543
/* First try using the /proc filesystem. */
2544-
if ((procdir = opendir("/proc")) != NULL) {
2544+
if ((procdir = opendir("/proc"))) {
25452545
# if defined(MAXPATHLEN)
25462546
char fname[MAXPATHLEN];
25472547
# elif defined(PATH_MAX)

thirdparty/KWSys/adios2sys/ProcessWin32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,14 +666,14 @@ int kwsysProcess_SetWorkingDirectory(kwsysProcess* cp, const char* dir)
666666
if (dir && dir[0]) {
667667
wchar_t* wdir = kwsysEncoding_DupToWide(dir);
668668
/* We must convert the working directory to a full path. */
669-
DWORD length = GetFullPathNameW(wdir, 0, 0, 0);
669+
DWORD length = GetFullPathNameW(wdir, 0, NULL, NULL);
670670
if (length > 0) {
671671
wchar_t* work_dir = malloc(length * sizeof(wchar_t));
672672
if (!work_dir) {
673673
free(wdir);
674674
return 0;
675675
}
676-
if (!GetFullPathNameW(wdir, length, work_dir, 0)) {
676+
if (!GetFullPathNameW(wdir, length, work_dir, NULL)) {
677677
free(work_dir);
678678
free(wdir);
679679
return 0;

0 commit comments

Comments
 (0)