You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
916 B
24 lines
916 B
/* |
|
* Copyright (C) 2023 Riyi |
|
* |
|
* SPDX-License-Identifier: MIT |
|
*/ |
|
|
|
#pragma once |
|
|
|
#include "blaze/eval.h" |
|
|
|
#define CONCAT(a, b) CONCAT_IMPL(a, b) |
|
#define CONCAT_IMPL(a, b) a##b |
|
|
|
#define EVAL_FUNCTION_IMPL(name, signature, documentation, struct_name) \ |
|
struct struct_name { \ |
|
struct_name() \ |
|
{ \ |
|
Eval::registerSpecialForm({ name, signature, documentation }); \ |
|
} \ |
|
}; \ |
|
static struct struct_name struct_name; // NOLINT(clang-diagnostic-unused-function) |
|
|
|
#define EVAL_FUNCTION(name, signature, documentation) \ |
|
EVAL_FUNCTION_IMPL(name, signature, documentation, CONCAT(__EVAL_STRUCT_, __COUNTER__))
|
|
|