From 33ca68239b34caa8cfe5912f51e0d4a493de9984 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 22 Aug 2026 13:08:13 +1000 Subject: [PATCH 01/10] markdown files --- AUTHORS.md | 2 +- FAQ.md | 1 + HISTORY.md | 2 +- NEWS.md | 2 +- REQUISITES.md | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 703a314..3b4cbb1 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,4 +1,4 @@ -# libpath - AUTHORS +# libpath - Authors diff --git a/FAQ.md b/FAQ.md index e69de29..810826c 100644 --- a/FAQ.md +++ b/FAQ.md @@ -0,0 +1 @@ +# libpath - FAQ diff --git a/HISTORY.md b/HISTORY.md index 2627024..a64cd69 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,4 @@ -# libpath - History +# libpath - History 15th March 2025 - 0.3.0-alpha1 released --------------------------------------- diff --git a/NEWS.md b/NEWS.md index 44fa2aa..b7c2702 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# libpath - News +# libpath - News | Date | News Item | | --------------------- | ----------------------------------------- | diff --git a/REQUISITES.md b/REQUISITES.md index e69de29..e462f22 100644 --- a/REQUISITES.md +++ b/REQUISITES.md @@ -0,0 +1 @@ +# libpath - Requisites From da3ceb213f839a29e83f21794925019384718228 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 09:34:24 +1000 Subject: [PATCH 02/10] chore(c-cpp): union files.associations from ~/dev vscode settings Give the 28 in-wave C/C++ projects (and gold **c** / **cxx** / **c_cxx** templates) a sorted **files.associations** union of all associations found under **~/dev**; --- .editorconfig | 55 +++++++++++++++++++++++++++++++++++++++++++ .vscode/settings.json | 47 +++++++++++++++++++++++++++++++++++- 2 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..47f1966 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,55 @@ +root = true + +# Language indent/EOL/charset overlap with .vscode/settings.json. +# Rulers, renderWhitespace, detectIndentation, mergeEditor, and +# language-server settings cannot be expressed here — they stay in +# settings.json. + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +# [bat] +[*.{bat,cmd}] +end_of_line = crlf +indent_size = 4 +indent_style = space + +# [c] +[*.{c,h}] +indent_size = 4 +indent_style = space + +# [cmake] +[{CMakeLists.txt,*.cmake}] +indent_size = 4 +indent_style = tab + +# [cpp] +[*.{cpp,cxx,hpp,hxx}] +indent_size = 4 +indent_style = space + +# [json] +[*.json] +indent_size = 2 +indent_style = space + +# [markdown] +[*.md] +indent_size = 2 +indent_style = space + +# [shellscript] +[*.{bash,sh,zsh}] +indent_size = 2 +indent_style = space + +# [yaml] +[*.{yaml,yml}] +indent_size = 2 +indent_style = space diff --git a/.vscode/settings.json b/.vscode/settings.json index c992df2..6a0da10 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,8 @@ "editor.tabSize": 4, }, "[c]": { + "editor.defaultFormatter": "ms-vscode.cpptools", + "editor.formatOnSave": true, "editor.insertSpaces": true, "editor.rulers": [ 60, 64, 68, 72, 76 ], "editor.tabSize": 4, @@ -14,6 +16,8 @@ "editor.tabSize": 4, }, "[cpp]": { + "editor.defaultFormatter": "ms-vscode.cpptools", + "editor.formatOnSave": true, "editor.insertSpaces": true, "editor.rulers": [ 60, 64, 68, 72, 76 ], "editor.tabSize": 4, @@ -49,13 +53,28 @@ "editor.insertSpaces": true, "editor.tabSize": 2, }, + "C_Cpp.autocompleteAddParentheses": true, + "C_Cpp.clang_format_fallbackStyle": "none", + "C_Cpp.clang_format_style": "file", + "C_Cpp.default.cStandard": "c17", + "C_Cpp.default.cppStandard": "c++17", + "C_Cpp.enhancedColorization": "enabled", + "C_Cpp.errorSquiggles": "enabled", + "C_Cpp.formatting": "clangFormat", + "C_Cpp.intelliSenseEngine": "default", "cmake.configureOnOpen": false, + "debug.allowBreakpointsEverywhere": true, "editor.detectIndentation": false, "editor.insertSpaces": false, "editor.renderWhitespace": "all", "editor.rulers": [ 76 ], "editor.tabSize": 2, "files.associations": { + "*.gemspec": "ruby", + "*.mdoc": "troff", + "*.roff": "troff", + "Gemfile": "ruby", + "Rakefile": "ruby", "__bit_reference": "cpp", "__bits": "cpp", "__config": "cpp", @@ -76,13 +95,17 @@ "__tuple": "cpp", "__verbose_abort": "cpp", "algorithm": "cpp", + "api.h": "c", "array": "cpp", "atomic": "cpp", + "auto_buffer.h": "c", "bit": "cpp", "bitset": "cpp", "cctype": "cpp", "charconv": "cpp", "chrono": "cpp", + "clasp.h": "c", + "cli_helpers.h": "c", "clocale": "cpp", "cmath": "cpp", "compare": "cpp", @@ -109,6 +132,7 @@ "functional": "cpp", "implicit_link.h": "c", "initializer_list": "cpp", + "invoke.h": "c", "io.h": "c", "iomanip": "cpp", "ios": "cpp", @@ -119,29 +143,48 @@ "limits": "cpp", "list": "cpp", "locale": "cpp", + "main.h": "c", "map": "cpp", "memory": "cpp", "memory_resource": "cpp", "mutex": "cpp", + "net_helpers.h": "c", "new": "cpp", + "numbers": "cpp", "numeric": "cpp", "optional": "cpp", "ostream": "cpp", + "path_functions.h": "c", + "print": "cpp", "queue": "cpp", + "random": "cpp", + "ranges": "cpp", "ratio": "cpp", + "rc.h": "c", + "recls.h": "c", + "result_codes_.h": "c", + "semaphore": "cpp", "set": "cpp", "setenv.h": "c", "shwild.h": "c", + "sleep_functions.h": "c", + "span": "cpp", "sstream": "cpp", "stack": "cpp", + "stdatomic.h": "c", + "stdbool.h": "c", "stdexcept": "cpp", "stdio.h": "c", + "stock.h": "c", + "stop_token": "cpp", "streambuf": "cpp", "string": "cpp", "string_view": "cpp", "system_error": "cpp", "terse-api.h": "c", + "text_encoding": "cpp", "thread": "cpp", + "trace.h": "c", "tuple": "cpp", "type_traits": "cpp", "typeinfo": "cpp", @@ -152,7 +195,9 @@ "utility": "cpp", "variant": "cpp", "vector": "cpp", + "williamscrc.h": "c", "xfacet": "cpp", + "xhash": "cpp", "xiosbase": "cpp", "xlocale": "cpp", "xlocbuf": "cpp", @@ -170,5 +215,5 @@ }, "files.insertFinalNewline": true, "files.trimTrailingWhitespace": true, + "git.mergeEditor": false, } - From 29bcb2eaab82f247c709e663427c86a1ec07000f Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 10:13:30 +1000 Subject: [PATCH 03/10] .gitattributes --- .gitattributes | 111 ++++++++++++++++++++++++----- .gitignore | 184 +++++++++++++++++++++---------------------------- 2 files changed, 171 insertions(+), 124 deletions(-) diff --git a/.gitattributes b/.gitattributes index 847b22d..76a2f86 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,22 +1,99 @@ -*.c linguist-language=C -*.h linguist-language=C +# .gitattributes — C / C++ (GitHub-hosted) +# +# Sources: GitHub Docs (line endings), git-scm gitattributes (diff=cpp), +# gitattributes/gitattributes C++.gitattributes + Common.gitattributes, +# github-linguist overrides. -*.cpp linguist-language=C++ -*.hpp linguist-language=C++ -*.cxx linguist-language=C++ -*.hxx linguist-language=C++ +# Default: detect text, normalize to LF in the repository +* text=auto -*.cmake linguist-language=CMake +# --- Source --- +*.c text diff=cpp +*.c++ text diff=cpp +*.cc text diff=cpp +*.cpp text diff=cpp +*.cxx text diff=cpp +*.h text diff=cpp +*.h++ text diff=cpp +*.hh text diff=cpp +*.hpp text diff=cpp +*.hxx text diff=cpp +*.inc text +*.inl text +*.ipp text +*.tcc text +*.tpp text -*.cmd linguist-detectable=false -*.html linguist-detectable=false -*.sh linguist-detectable=false -*.dsp linguist-detectable=false -*.dsw linguist-detectable=false -*.sln linguist-detectable=false -*.vimrc linguist-detectable=false -*.vcxproj linguist-detectable=false +# --- Build / config --- +*.am text +*.cmake text +*.m4 text +*.mak text +*.mk text +*akefile text +CMakeLists.txt text +configure text eol=lf +configure.ac text -CMakeLists.txt linguist-language=CMake -makefile linguist-detectable=false +# --- Scripts --- +*.bash text eol=lf +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf +*.sh text eol=lf +*.zsh text eol=lf +# --- Docs / meta --- +*.adoc text +*.markdown text diff=markdown +*.md text diff=markdown +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +LICENSE text +NEWS text +README text +TODO text +.gitattributes text +.gitignore text + +# --- Serialisation --- +*.json text +*.toml text +*.xml text +*.yaml text +*.yml text + +# --- Compiled / binary artefacts --- +*.a binary +*.dll binary +*.dylib binary +*.exe binary +*.gch binary +*.la binary +*.lai binary +*.lib binary +*.lo binary +*.o binary +*.obj binary +*.out binary +*.pch binary +*.slo binary +*.so binary + +# --- Archives / images (common) --- +*.gif binary +*.gz binary +*.ico binary +*.jpeg binary +*.jpg binary +*.png binary +*.tar binary +*.zip binary + +# --- GitHub Linguist --- +**/build/** linguist-generated +**/cmake-build-*/** linguist-generated diff --git a/.gitignore b/.gitignore index eed185f..226c160 100644 --- a/.gitignore +++ b/.gitignore @@ -1,166 +1,127 @@ -# Synesis Information Systems .gitignore for C/C++ libraries +# Synesis Information Systems .gitignore for C / C++ libraries # directories (by name) -/.git-old/ -/.vs/ +bin/ +ideas/ +ipch/ +lib/ +scripts/internal/ +Win32/ +x64/ +.idea/ .svn/ +.vs/ -.classpath -/.idea/ -/__pycache__ -/node_modules +__pycache__/ -/_build/ +/_analyses/ /_build-ci/ +/_build/ /_internal/ -/_analyses/ - -/bin/ -/ipch/ -/lib/ -bin/ -ipch/ -lib/ -/doc/ /docs/ /dox/ -/dox /ideas/ -ideas/ +/include/xcontract/ +/include/xcover/ /included/ +/node_modules/ /releases/ /scratch/ -/temp/ - -/--include -/--src -/-include -/-src - -/examples/bin -/examples/c/bin -/examples/cpp/bin - -/examples/lib -/examples/c/lib -/examples/cpp/lib - -projects/util/vc10-generated/ - -perf_test/ - -scripts/internal/ - -/include/b64/ -/include/shwild/ -/include/xcontract/ -/include/xcover/ -/include/xtests/ -/src/b64/ -/src/shwild/ /src/xcontract/ /src/xcover/ -/src/xtests/ +/target/ +/temp/ + +/examples/bin/ +/examples/c/bin/ +/examples/c/lib/ +/examples/cpp/bin/ +/examples/cpp/lib/ +/examples/lib/ -Debug Multithreaded DLL/ Debug Multithreaded Dll/ -Debug Multithreaded pseudoUNIX/ +Debug Multithreaded DLL/ Debug Multithreaded pseudoUnix/ +Debug Multithreaded pseudoUNIX/ Debug Multithreaded/ Debug/ +DebugDll/ DebugDLL/ DebugDLLUNIX/ -DebugDll/ -DebugMTDLL/ +DebugMt/ DebugMTDll/ +DebugMTDLL/ DebugMTUnix/ -DebugMt/ DebugNox/ -DebugUNIX/ DebugUnix/ -Release Multithreaded DLL/ +DebugUNIX/ Release Multithreaded Dll/ -Release Multithreaded pseudoUNIX/ +Release Multithreaded DLL/ Release Multithreaded pseudoUnix/ +Release Multithreaded pseudoUNIX/ Release Multithreaded/ Release/ +ReleaseDll/ ReleaseDLL/ ReleaseDLLUNIX/ -ReleaseDll/ -ReleaseMTDLL/ +ReleaseMt/ ReleaseMTDll/ +ReleaseMTDLL/ ReleaseMTUnix/ -ReleaseMt/ ReleaseNox/ ReleaseUnix/ UDebug/ UDebugMt/ -URelease/ -UReleaseMt/ -Unicode Debug Multithreaded DLL/ Unicode Debug Multithreaded Dll/ +Unicode Debug Multithreaded DLL/ Unicode Debug Multithreaded/ Unicode Debug/ -Unicode Release Multithreaded DLL/ Unicode Release Multithreaded Dll/ +Unicode Release Multithreaded DLL/ Unicode Release Multithreaded/ Unicode Release/ - -Win32/ -x64/ +URelease/ +UReleaseMt/ # directories (by pattern) -/build/ar* -/build/bc5* -/build/como* -/build/cw* -/build/gcc3* -/build/gcc4* -/build/icl* -/build/vc5* -/build/*.zip - /include-*/ # files (by name) .DS_Store + +.classpath +.env.development.local +.env.local +.env.production.local +.env.test.local .ruby-version -.ruby-version-exclusions .svnignore .svnignore-at-root .update_deps -.env.local -.env.development.local -.env.test.local -.env.production.local - -list_changes.cmd -logging-bailout.txt -prepare.cmd -sh.exe.stackdump -tidydir.cmd -update_deps.cmd +build/CMakeCache.txt build/makefile.tmpl build/makefile.tools.xml build/shwild.tmplgen -build/CMakeCache.txt - -include/fastformat/internal/dos2unix.has.been.performed include/pantheios/internal/dos2unix.has.been.performed include/stlsoft/dos2unix.has.been.performed include/stlsoft/internal/dos2unix.has.been.performed - +list_changes.cmd +logging-bailout.txt +prepare.cmd +sh.exe.stackdump test/testpatterns.orj test/tests-plan.txt +tidydir.cmd +update_deps.cmd # files (by pattern) @@ -168,8 +129,6 @@ test/tests-plan.txt *~ *.*~ *.???_obj -*.VC.db -*.VC.opendb *.a *.app *.aps @@ -177,6 +136,7 @@ test/tests-plan.txt *.bak *.chm *.class +*.csproj*user *.d *.diff *.dll @@ -213,32 +173,42 @@ test/tests-plan.txt *.slo *.so *.suo -*.swp *.sw[ponm] +*.swp *.test *.tlog *.tmp *.unsuccessfulbuild -*.vcproj*.user -*.vcxproj*.user -*.csproj*user -*.vcproj*user -*.vcxproj*user +*.VC.db +*.VC.opendb *.xcuserstate *.zip -*.vc71.sln -*.vc8.sln -*.vc9.sln +/build/*.tmpl +/build/*.tmplgen +/build/*.tools.xml +/build/*.zip +/build/ar* +/build/bc5* +/build/como* +/build/cw* +/build/gcc3* +/build/gcc4* +/build/icl* +/build/vc5* RCa0* RCb0* -build/*.tmplgen -build/*.tmpl -build/*.tools.xml - npm-debug.log* yarn-debug.log* yarn-error.log* +*.vc71.sln +*.vc8.sln +*.vc9.sln +*.vcproj*.user +*.vcproj*user +*.vcxproj*.user +*.vcxproj*user + From 9bc0b9300bc182533e6ceb4de6604936b6bf71aa Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 10:17:30 +1000 Subject: [PATCH 04/10] .vscode/settings.json --- .vscode/settings.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 6a0da10..6aa78f6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,7 @@ "editor.defaultFormatter": "ms-vscode.cpptools", "editor.formatOnSave": true, "editor.insertSpaces": true, - "editor.rulers": [ 60, 64, 68, 72, 76 ], + "editor.rulers": [ 60, 64, 68, 72, 76, 120 ], "editor.tabSize": 4, }, "[cmake]": { @@ -19,7 +19,7 @@ "editor.defaultFormatter": "ms-vscode.cpptools", "editor.formatOnSave": true, "editor.insertSpaces": true, - "editor.rulers": [ 60, 64, 68, 72, 76 ], + "editor.rulers": [ 60, 64, 68, 72, 76, 120 ], "editor.tabSize": 4, }, "[json]": { @@ -38,6 +38,7 @@ }, "[ruby]": { "editor.insertSpaces": true, + "editor.rulers": [ 60, 76 ], "editor.tabSize": 2, }, "[shellscript]": { From 95d7ccec4430fb63cec54f23e03078ab9dff5802 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 10:18:51 +1000 Subject: [PATCH 05/10] .vimrc --- .vimrc | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.vimrc b/.vimrc index 3be09bc..cebe6af 100644 --- a/.vimrc +++ b/.vimrc @@ -17,12 +17,12 @@ set fixeol set list set listchars=tab:->,trail:-,extends:>,precedes:<,nbsp:+ -" editor.detectIndentation: false — global defaults (editor.tabSize: 2, insertSpaces: false) -set tabstop=2 -set shiftwidth=2 -set softtabstop=2 -set noexpandtab +" editor.detectIndentation: false — global defaults (editor.tabSize: 4, insertSpaces: true) set colorcolumn=76 +set expandtab +set shiftwidth=4 +set softtabstop=4 +set tabstop=4 " colorcolumn draws a full-column tint in Vim (not a VS Code-style 1px line). " Keep it subtle via the ColorColumn highlight group; reapply after colorscheme changes. @@ -42,6 +42,8 @@ autocmd BufWritePre * %s/\s\+$//e augroup sis_c_cxx autocmd! + " [bat] + autocmd FileType bat,dosbatch setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76 " [c] / [cpp] autocmd FileType c,cpp setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,64,68,72,76 @@ -49,19 +51,20 @@ augroup sis_c_cxx " [cmake] autocmd FileType cmake setlocal noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 - " [shellscript] - autocmd FileType sh,bash,zsh setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76 - - " [bat] - autocmd FileType bat,dosbatch setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76 - - " [json] / [markdown] / [yaml] / [ruby] - autocmd FileType json,markdown,yaml,ruby setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 + " [json] / [markdown] / [ruby] / [yaml] + autocmd FileType json,markdown,ruby,yaml setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 " [python] autocmd FileType python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76 + " [rust] + autocmd FileType rs setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=76 + + " [shellscript] + autocmd FileType bash,sh,zsh setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76 + " [toml] autocmd FileType toml setlocal noexpandtab tabstop=2 shiftwidth=2 softtabstop=2 + augroup END From fea94614ebdbb2498cdd5f883f7e47592addc0ea Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 10:19:37 +1000 Subject: [PATCH 06/10] .sis --- .sis/project_name.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 .sis/project_name.txt diff --git a/.sis/project_name.txt b/.sis/project_name.txt new file mode 100644 index 0000000..097faed --- /dev/null +++ b/.sis/project_name.txt @@ -0,0 +1 @@ +libpath From 00bdd237536765519f4dcd745f4efe8330b58646 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 17 Sep 2026 11:14:08 +1000 Subject: [PATCH 07/10] chore(): use computed PREFIX_VER with documented PATCH Align library version macros to c-cpp-standards. Define MAJOR, MINOR, PATCH, and ALPHABETA; compute PREFIX_VER by shifts; keep REVISION as a skip-section alias of PATCH (target at column 60); retain named historical VER_* constants only for comparison and documentation. --- include/libpath/common/version.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/libpath/common/version.h b/include/libpath/common/version.h index ac1353d..78f95c1 100644 --- a/include/libpath/common/version.h +++ b/include/libpath/common/version.h @@ -4,11 +4,11 @@ * Purpose: Portability discrimination for libpath library. * * Created: 9th November 2012 - * Updated: 14th March 2025 + * Updated: 17th September 2026 * * Home: https://github.com/synesissoftware/libpath * - * Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems + * Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems * Copyright (c) 2012-2019, Matthew Wilson and Synesis Software * All rights reserved. * @@ -105,7 +105,9 @@ | ( LIBPATH_VER_ALPHABETA << 0 ) \ ) -#define LIBPATH_VER_REVISION LIBPATH_VER_PATCH +#ifndef LIBPATH_DOCUMENTATION_SKIP_SECTION +# define LIBPATH_VER_REVISION LIBPATH_VER_PATCH +#endif /* !LIBPATH_DOCUMENTATION_SKIP_SECTION */ /* ////////////////////////////////////////////////////////////////////// */ From 2589c53ffc3cdbafe5800a765bbb62998a7b83cb Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 18 Sep 2026 07:30:48 +1000 Subject: [PATCH 08/10] test: add canonical scratch versions reporter Add a Phase 3 gold version printer under test/scratch/versions, wire it from the scratch parent list, and use CMake target/argv0 versions; --- test/scratch/CMakeLists.txt | 2 +- test/scratch/versions/CMakeLists.txt | 1 + test/scratch/versions/main.cpp | 58 ++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 test/scratch/versions/CMakeLists.txt create mode 100644 test/scratch/versions/main.cpp diff --git a/test/scratch/CMakeLists.txt b/test/scratch/CMakeLists.txt index d6f5b2d..2fa9908 100644 --- a/test/scratch/CMakeLists.txt +++ b/test/scratch/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(test.scratch.compare.models) +add_subdirectory(versions) # ############################## end of file ############################# # - diff --git a/test/scratch/versions/CMakeLists.txt b/test/scratch/versions/CMakeLists.txt new file mode 100644 index 0000000..65e971e --- /dev/null +++ b/test/scratch/versions/CMakeLists.txt @@ -0,0 +1 @@ +define_example_program(versions main.cpp) diff --git a/test/scratch/versions/main.cpp b/test/scratch/versions/main.cpp new file mode 100644 index 0000000..8fde368 --- /dev/null +++ b/test/scratch/versions/main.cpp @@ -0,0 +1,58 @@ + +#include + +#include +#include + +#include + + +#define PROGRAM_NAME "versions" + + +template< + typename T_stream +, typename T_integer +> +void +version( + T_stream& stm +, char const* prefix +, char const* libname +, char const* macroname +, T_integer libver +) +{ + stm + << prefix + << libname + << ": v" + << ((libver >> 24) & 0xff) + << '.' + << ((libver >> 16) & 0xff) + << '.' + << ((libver >> 8) & 0xff) + << '.' + << ((libver >> 0) & 0xff) + << " (" + << macroname + << " = 0x" + << std::hex << std::setfill('0') << std::setw(8) + << static_cast(libver) + << std::dec + << ")" + << std::endl + ; +} + + +int main(int /* argc */, char* /* argv */[]) +{ + { + unsigned const libver = LIBPATH_VER; + + version(std::cout, "", "libpath", "LIBPATH_VER", libver); + } + + return EXIT_SUCCESS; +} From 82b0f1447e47db1b177a960d85c05234fd4f502f Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Tue, 22 Sep 2026 05:09:54 +1000 Subject: [PATCH 09/10] .gitattributes --- .gitattributes | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.gitattributes b/.gitattributes index 76a2f86..1ad0590 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,6 +3,11 @@ # Sources: GitHub Docs (line endings), git-scm gitattributes (diff=cpp), # gitattributes/gitattributes C++.gitattributes + Common.gitattributes, # github-linguist overrides. +# +# Linguist language-bar policy (Synesis): classify public C API headers as C +# and *.cmake as CMake scripts; keep helper scripts, IDE project files, and +# CMakeLists.txt config out of the advertised language mix. Prefer +# -linguist-detectable over linguist-detectable=false. # Default: detect text, normalize to LF in the repository * text=auto @@ -97,3 +102,25 @@ TODO text # --- GitHub Linguist --- **/build/** linguist-generated **/cmake-build-*/** linguist-generated + +# Classification (C-primary / C API with C++ tests; *.cmake as CMake scripts) +*.c linguist-language=C +*.cmake linguist-language=CMake +*.cpp linguist-language=C++ +*.cxx linguist-language=C++ +*.h linguist-language=C +*.hpp linguist-language=C++ +*.hxx linguist-language=C++ + +# Keep the bar on library languages (helpers / legacy IDE / docs / +# CMakeLists.txt config; leave *.cmake detectable as CMake) +*.cmd -linguist-detectable +*.dsp -linguist-detectable +*.dsw -linguist-detectable +*.html -linguist-detectable +*.sh -linguist-detectable +*.sln -linguist-detectable +*.vcxproj -linguist-detectable +*.vimrc -linguist-detectable +CMakeLists.txt -linguist-detectable +makefile -linguist-detectable From b2b3690d18129ac4dd08cb5a021efbb68ff5b83d Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Tue, 22 Sep 2026 09:02:35 +1000 Subject: [PATCH 10/10] fix(c-cpp): quote Dir resolution in CMake helper scripts Use Dir=$(cd "$(dirname "$ScriptPath")" && pwd) so paths with spaces resolve reliably; apply the same one-line fix across in-wave helper scripts (prepare/build/clean/ctest/remove and run_all_*). --- build_cmake.sh | 2 +- clean_cmake.sh | 2 +- prepare_cmake.sh | 2 +- remove_cmake_artefacts.sh | 2 +- run_all_examples.sh | 2 +- run_all_scratch_tests.sh | 2 +- run_all_unit_tests.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build_cmake.sh b/build_cmake.sh index 3e0af65..0c28049 100755 --- a/build_cmake.sh +++ b/build_cmake.sh @@ -1,7 +1,7 @@ #! /bin/bash ScriptPath=$0 -Dir=$(cd $(dirname "$ScriptPath"); pwd) +Dir=$(cd "$(dirname "$ScriptPath")" && pwd) Basename=$(basename "$ScriptPath") CMakeDir=${SIS_CMAKE_BUILD_DIR:-$Dir/_build} MakeCmd=${SIS_CMAKE_COMMAND:-make} diff --git a/clean_cmake.sh b/clean_cmake.sh index a128668..6da04ed 100755 --- a/clean_cmake.sh +++ b/clean_cmake.sh @@ -1,7 +1,7 @@ #! /bin/bash ScriptPath=$0 -Dir=$(cd $(dirname "$ScriptPath"); pwd) +Dir=$(cd "$(dirname "$ScriptPath")" && pwd) Basename=$(basename "$ScriptPath") CMakeDir=${SIS_CMAKE_BUILD_DIR:-$Dir/_build} MakeCmd=${SIS_CMAKE_COMMAND:-make} diff --git a/prepare_cmake.sh b/prepare_cmake.sh index 5f03a74..4153fcc 100755 --- a/prepare_cmake.sh +++ b/prepare_cmake.sh @@ -1,7 +1,7 @@ #! /bin/bash ScriptPath=$0 -Dir=$(cd $(dirname "$ScriptPath"); pwd) +Dir=$(cd "$(dirname "$ScriptPath")" && pwd) Basename=$(basename "$ScriptPath") CMakeDir=${SIS_CMAKE_BUILD_DIR:-$Dir/_build} MakeCmd=${SIS_CMAKE_COMMAND:-make} diff --git a/remove_cmake_artefacts.sh b/remove_cmake_artefacts.sh index 7416db9..09adac1 100755 --- a/remove_cmake_artefacts.sh +++ b/remove_cmake_artefacts.sh @@ -1,7 +1,7 @@ #! /bin/bash ScriptPath=$0 -Dir=$(cd $(dirname "$ScriptPath"); pwd) +Dir=$(cd "$(dirname "$ScriptPath")" && pwd) Basename=$(basename "$ScriptPath") CMakeDir=${SIS_CMAKE_BUILD_DIR:-$Dir/_build} diff --git a/run_all_examples.sh b/run_all_examples.sh index 36154da..68f2bad 100755 --- a/run_all_examples.sh +++ b/run_all_examples.sh @@ -1,7 +1,7 @@ #! /bin/bash ScriptPath=$0 -Dir=$(cd $(dirname "$ScriptPath"); pwd) +Dir=$(cd "$(dirname "$ScriptPath")" && pwd) Basename=$(basename "$ScriptPath") CMakeDir=${SIS_CMAKE_BUILD_DIR:-$Dir/_build} [[ -n "$MSYSTEM" ]] && DefaultMakeCmd=mingw32-make.exe || DefaultMakeCmd=make diff --git a/run_all_scratch_tests.sh b/run_all_scratch_tests.sh index 7aa99d8..7d1d6b9 100755 --- a/run_all_scratch_tests.sh +++ b/run_all_scratch_tests.sh @@ -1,7 +1,7 @@ #! /bin/bash ScriptPath=$0 -Dir=$(cd $(dirname "$ScriptPath"); pwd) +Dir=$(cd "$(dirname "$ScriptPath")" && pwd) Basename=$(basename "$ScriptPath") CMakeDir=${SIS_CMAKE_BUILD_DIR:-$Dir/_build} [[ -n "$MSYSTEM" ]] && DefaultMakeCmd=mingw32-make.exe || DefaultMakeCmd=make diff --git a/run_all_unit_tests.sh b/run_all_unit_tests.sh index 24a1140..435489f 100755 --- a/run_all_unit_tests.sh +++ b/run_all_unit_tests.sh @@ -1,7 +1,7 @@ #! /bin/bash ScriptPath=$0 -Dir=$(cd $(dirname "$ScriptPath"); pwd) +Dir=$(cd "$(dirname "$ScriptPath")" && pwd) Basename=$(basename "$ScriptPath") CMakeDir=${SIS_CMAKE_BUILD_DIR:-$Dir/_build} MakeCmd=${SIS_CMAKE_COMMAND:-make}