Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: "false"
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakBeforeMultilineStrings: true
Expand Down Expand Up @@ -42,7 +43,7 @@ PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
RequiresClausePosition: OwnLine
RequiresClausePosition: OwnLineWithBrace
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/ci_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cpp_version: [ 17, 20 ]
build_type: [ Debug, Release ]
os: [ ubuntu-24.04 ]
toolset: [ g++-12, g++-13, clang++-13, clang++-14, clang++-15, clang++-16, clang++-17, clang++-18, clang++-19, clang++-20 ]
toolset: [ g++-12, g++-13, clang++-19, clang++-20 ]
exclude:
- toolset: g++-12
cpp_version: 20
Expand All @@ -43,15 +43,9 @@ jobs:
if: endsWith( matrix.os, '24.04' )
run: |
sudo wget -O /etc/apt/trusted.gpg.d/llvm.asc https://apt.llvm.org/llvm-snapshot.gpg.key
sudo apt-add-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main'
sudo apt-add-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-13 main'
sudo apt-add-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main'
sudo apt-add-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main'
sudo apt-add-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main'
sudo apt-add-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main'
sudo apt-add-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
sudo apt-add-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main'
sudo apt-add-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main'
sudo apt-add-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble main'
sudo apt-add-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main'
sudo apt-add-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main'
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install ninja-build libunwind-dev
Expand Down
71 changes: 62 additions & 9 deletions .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,72 @@
name: Windows

on:
schedule:
- cron: '10 5 * * *'
push:
branches-ignore: dev
branches: [ release, develop ]
pull_request:
branches-ignore: dev
push:
branches-ignore: develop
pull_request:
branches-ignore: develop

jobs:
build:
runs-on: [windows-2019]
Windows:
permissions:
actions: none
checks: none
contents: none
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
config:
- { cpp_version: 17, build_type: Debug, arch: x64, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
- { cpp_version: 17, build_type: Release, arch: x64, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
- { cpp_version: 20, build_type: Debug, arch: x64, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
- { cpp_version: 20, build_type: Release, arch: x64, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
- { cpp_version: 17, build_type: Debug, arch: Win32, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
- { cpp_version: 17, build_type: Release, arch: Win32, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
- { cpp_version: 20, build_type: Debug, arch: Win32, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
- { cpp_version: 20, build_type: Release, arch: Win32, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
- { cpp_version: 23, build_type: Debug, arch: Win32, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
- { cpp_version: 23, build_type: Release, arch: Win32, os: windows-2022, toolset: MSVC, cmake_flags: "-GNinja" }
- { cpp_version: 23, build_type: Debug, arch: Win32, os: windows-2022, toolset: ClangCL, cmake_flags: " -T ClangCL -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe" }
- { cpp_version: 23, build_type: Release, arch: Win32, os: windows-2022, toolset: ClangCL, cmake_flags: " -T ClangCL -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe" }
runs-on: ${{ matrix.config.os }}
name: "${{ matrix.config.os }} ${{ matrix.config.toolset }} ${{ matrix.config.cpp_version }} ${{ matrix.config.arch }} ${{ matrix.config.build_type }}"
env:
DAW_BUILD_DIR: "build_${{ matrix.config.cpp_version }}_${{ matrix.config.arch }}_${{ matrix.config.build_type }}_${{ matrix.config.toolset }}"
steps:
- uses: actions/checkout@v1
- uses: beached/msvc-dev-cmd@285e7c0b9b57a02c900951da93a77e656425d783
with:
arch: ${{ matrix.config.arch }}
- name: Setup Build Environment
run: md ${{ env.DAW_BUILD_DIR }}
- name: CMake Config
run: cmake.exe ${{ matrix.config.cmake_flags }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.config.cpp_version }} -DDAW_ENABLE_TESTING=On -B${{ env.DAW_BUILD_DIR }}/ .
- name: Build
run: .\ci_scripts\ci_windows_build.cmd
run: cmake.exe --build ${{ env.DAW_BUILD_DIR }}/ --target daw-header-libraries_full --config ${{ matrix.config.build_type }}
continue-on-error: true
- name: Test
run: .\ci_scripts\ci_windows_test.cmd
- name: InstallTest
run: .\ci_scripts\ci_windows_install_test.cmd
run: ctest.exe -C ${{ matrix.config.build_type }} -j2 -VV --timeout 1200 --test-dir ${{ env.DAW_BUILD_DIR }}/
- name: Archive any crashes as an artifact
uses: actions/upload-artifact@v4
if: always( )
with:
name: crashes
path: |
crash-*
leak-*
timeout-*
if-no-files-found: ignore
18 changes: 0 additions & 18 deletions .github/workflows/ci_windows_clangcl.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
cmake_minimum_required( VERSION 3.14 )

project( "daw-header-libraries"
VERSION "2.124.1"
VERSION "2.127.0"
DESCRIPTION "Various headers"
HOMEPAGE_URL "https://github.com/beached/header_libraries"
LANGUAGES C CXX
Expand Down
22 changes: 0 additions & 22 deletions ci_scripts/ci_windows_build.cmd

This file was deleted.

16 changes: 0 additions & 16 deletions ci_scripts/ci_windows_build_clangcl.cmd

This file was deleted.

20 changes: 0 additions & 20 deletions ci_scripts/ci_windows_install_test.cmd

This file was deleted.

20 changes: 0 additions & 20 deletions ci_scripts/ci_windows_install_test_clangcl.cmd

This file was deleted.

6 changes: 0 additions & 6 deletions ci_scripts/ci_windows_test.cmd

This file was deleted.

98 changes: 98 additions & 0 deletions include/daw/daw_ascii.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Copyright (c) Darrell Wright
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/beached/header_libraries
//

#pragma once

#include "daw/daw_attributes.h"
#include "daw/daw_cpp_feature_check.h"
#include "daw/impl/daw_make_trait.h"

#include <type_traits>

namespace daw {
struct is_ascii_digit_t {
explicit is_ascii_digit_t( ) = default;

template<typename Integer, std::enable_if_t<std::is_integral_v<Integer>,
std::nullptr_t> = nullptr>
DAW_ATTRIB_INLINE DAW_CPP23_STATIC_CALL_OP constexpr bool
operator( )( Integer c ) DAW_CPP23_STATIC_CALL_OP_CONST {
// '0' <= c <= '9'
return Integer{ 48 } <= c and c <= Integer{ 57 };
}
};
inline constexpr auto is_ascii_digit = is_ascii_digit_t{ };

struct is_ascii_alpha_t {
explicit is_ascii_alpha_t( ) = default;

template<typename Integer, std::enable_if_t<std::is_integral_v<Integer>,
std::nullptr_t> = nullptr>
DAW_ATTRIB_INLINE DAW_CPP23_STATIC_CALL_OP constexpr bool
operator( )( Integer c ) DAW_CPP23_STATIC_CALL_OP_CONST {
// ( 'A' <= c <= 'Z' ) or ( 'a' <= c <= 'z' )
return ( Integer{ 65 } <= c and c <= Integer{ 90 } ) or
( Integer{ 97 } <= c and c <= Integer{ 122 } );
}
};
inline constexpr auto is_ascii_alpha = is_ascii_alpha_t{ };

struct is_ascii_alphanum_t {
explicit is_ascii_alphanum_t( ) = default;

template<typename Integer, std::enable_if_t<std::is_integral_v<Integer>,
std::nullptr_t> = nullptr>
DAW_ATTRIB_INLINE DAW_CPP23_STATIC_CALL_OP constexpr bool
operator( )( Integer c ) DAW_CPP23_STATIC_CALL_OP_CONST {
return is_ascii_digit( c ) or is_ascii_alpha( c );
}
};
inline constexpr auto is_ascii_alphanum = is_ascii_alphanum_t{ };

struct is_ascii_printable_t {
explicit is_ascii_printable_t( ) = default;

template<typename Integer, std::enable_if_t<std::is_integral_v<Integer>,
std::nullptr_t> = nullptr>
DAW_ATTRIB_INLINE DAW_CPP23_STATIC_CALL_OP constexpr bool
operator( )( Integer c ) DAW_CPP23_STATIC_CALL_OP_CONST {
return Integer{ 32 } <= c and c < Integer{ 127 };
}
};
inline constexpr auto is_ascii_printable = is_ascii_printable_t{ };

struct to_upper_ascii_t {
explicit to_upper_ascii_t( ) = default;

template<typename Integer, std::enable_if_t<std::is_integral_v<Integer>,
std::nullptr_t> = nullptr>
DAW_ATTRIB_INLINE DAW_CPP23_STATIC_CALL_OP constexpr Integer
operator( )( Integer c ) DAW_CPP23_STATIC_CALL_OP_CONST {
if( Integer{ 97 } <= c and c <= Integer{ 122 } ) {
return static_cast<Integer>( c - Integer{ 32 } );
}
return c;
}
};
inline constexpr auto to_upper_ascii = to_upper_ascii_t{ };

struct to_lower_ascii_t {
explicit to_lower_ascii_t( ) = default;

template<typename Integer, std::enable_if_t<std::is_integral_v<Integer>,
std::nullptr_t> = nullptr>
DAW_ATTRIB_INLINE DAW_CPP23_STATIC_CALL_OP constexpr Integer
operator( )( Integer c ) DAW_CPP23_STATIC_CALL_OP_CONST {
if( Integer{ 65 } <= c and c <= Integer{ 90 } ) {
return static_cast<Integer>( c + Integer{ 32 } );
}
return c;
}
};
inline constexpr auto to_lower_ascii = to_lower_ascii_t{ };
} // namespace daw
2 changes: 1 addition & 1 deletion include/daw/daw_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

#endif

#if defined( DAW_HAS_MSVC )
#if defined( DAW_HAS_MSVC_LIKE )
#define DAW_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#else
#define DAW_NO_UNIQUE_ADDRESS [[no_unique_address]]
Expand Down
Loading
Loading