Skip to content

Commit

Permalink
Merge branch 'feature/channel.2' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
vector-of-bool committed Apr 1, 2024
2 parents ae425dd + c5d412b commit 0bcab9b
Show file tree
Hide file tree
Showing 48 changed files with 20,184 additions and 995 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,31 @@ jobs:
- name: Build and Test
run: bash tools/earthly.sh +build-gcc-10.3

# XXX: BROKEN due to compiler bugs. Investigate at a later date.
build-clang16:
name: Build for Clang 16
name: Build for Clang 16 [Compiler bugs]
runs-on: ubuntu-latest
if: ${{false}} # Skipped
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
run: bash tools/earthly.sh +build-clang-16

build-clang17:
name: Build for Clang 17 [Compiler bugs]
runs-on: ubuntu-latest
if: ${{false}} # Skipped
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
run: bash tools/earthly.sh +build-clang-17

build-vs2019:
name: Build for VS 2019
name: Build for VS 2019 [Compiler bugs]
runs-on: windows-2019
if: ${{false}} # Skipped
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ build-gcc:
build-gcc-10.3:
DO +ALPINE_BUILD --version=3.15 --prep=ALPINE_PREP_GCC --cxx_flags="-fcoroutines" --runtime_debug=false

build-clang-17:
DO +ALPINE_BUILD --version=3.19 --prep=ALPINE_PREP_CLANG

build-clang-16:
DO +ALPINE_BUILD --version=3.18 --prep=ALPINE_PREP_CLANG

Expand Down
47 changes: 47 additions & 0 deletions render.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# /// script
# requires-python = ">=3.8"
# dependencies = []
# "jinja2",
# ]
# ///
import sys
from typing import Any, Sequence
import jinja2
import argparse


def format_each(iterable: Any, s: str) -> Any:
return (s.format(x) for x in iterable)


_GENERATED_FILE_WARNING = """// d8888b. .d88b. d8b db .d88b. d888888b d88888b d8888b. d888888b d888888b
// 88 `8D .8P Y8. 888o 88 .8P Y8. `~~88~~' 88' 88 `8D `88' `~~88~~'
// 88 88 88 88 88V8o 88 88 88 88 88ooooo 88 88 88 88
// 88 88 88 88 88 V8o88 88 88 88 88~~~~~ 88 88 88 88
// 88 .8D `8b d8' 88 V888 `8b d8' 88 88. 88 .8D .88. 88
// Y8888D' `Y88P' VP V8P `Y88P' YP Y88888P Y8888D' Y888888P YP"""


def gen_warning(filename: str) -> str:
return f"{_GENERATED_FILE_WARNING}\n\n// This file was GENERATED from {filename}"


def main(argv: Sequence[str]) -> int:
parser = argparse.ArgumentParser(
description="Renders a Jinja template from stdin to stdout"
)
parser.parse_args(argv) # No arguments, but throws if arguments are provided
template_str = sys.stdin.read()
env = jinja2.Environment(
line_statement_prefix="#%",
line_comment_prefix="##",
)
env.filters["format_each"] = format_each # type: ignore
tmpl = env.from_string(template_str)
s = tmpl.render(generated_file_notice=gen_warning)
sys.stdout.write(s)
return 0


if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
16 changes: 3 additions & 13 deletions src/neo/addressof.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@

#include "./attrib.hpp"

// clang-format off
#if (NEO_HAS_BUILTIN(__builtin_addressof) || defined(_MSC_VER))
#define HAS_ADDROF_INTRIN 1
#endif
// clang-format on

#ifndef HAS_ADDROF_INTRIN
#if !NEO_HAS_BUILTIN(__builtin_addressof)
#include <memory>
#endif

Expand All @@ -20,7 +14,7 @@ namespace neo {
*/
template <typename T>
constexpr T* addressof(T& arg) noexcept {
#if HAS_ADDROF_INTRIN
#if NEO_HAS_BUILTIN(__builtin_addressof)
return __builtin_addressof(arg);
#else
return std::addressof(arg);
Expand All @@ -30,14 +24,10 @@ constexpr T* addressof(T& arg) noexcept {
template <typename T>
const T& addressof(const T&&) = delete;

#if HAS_ADDROF_INTRIN
#if NEO_HAS_BUILTIN(__builtin_addressof)
#define NEO_ADDRESSOF(X) __builtin_addressof((X))
#else
#define NEO_ADDRESSOF(X) std::addressof((X))
#endif

} // namespace neo

#ifdef HAS_ADDROF_INTRIN
#undef HAS_ADDROF_INTRIN
#endif
1 change: 1 addition & 0 deletions src/neo/attrib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#define NEO_MSVC_HAS_BUILTIN__is_unbounded_array
#define NEO_MSVC_HAS_BUILTIN__is_union
#define NEO_MSVC_HAS_BUILTIN__underlying_type
#define NEO_MSVC_HAS_BUILTIN__builtin_addressof

#define NEO_MSVC_HAS_BUILTIN__make_integer_seq

Expand Down
Loading

0 comments on commit 0bcab9b

Please sign in to comment.