// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef _ALIAS_UTILS_H_
#define_ALIAS_UTILS_H_#include<stdint.h>#include<stddef.h>#definealias_Closure(FN_T)struct{ FN_T fn;void* ud;}#definealias_Closure_call(C,...)(C)->fn((C)->ud, ## __VA_ARGS__)#definealias_Closure_is_empty(C)((C)->fn ==NULL)#defineALIAS_DECLARE_CLOSURE(NAME,RESULT_TYPE,...)\typedefRESULT_TYPE(* NAME##_function_type)(void*, ## __VA_ARGS__);\typedefalias_Closure(NAME##_function_type)NAME;#endif