From a51875001eb672d73c9d84d44bb32abce327b931 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sun, 2 Feb 2025 02:01:30 -0700 Subject: libmisc: Drop vcall.h --- libmisc/include/libmisc/vcall.h | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 libmisc/include/libmisc/vcall.h (limited to 'libmisc/include') diff --git a/libmisc/include/libmisc/vcall.h b/libmisc/include/libmisc/vcall.h deleted file mode 100644 index 31a8c7e..0000000 --- a/libmisc/include/libmisc/vcall.h +++ /dev/null @@ -1,28 +0,0 @@ -/* libmisc/vcall.h - A simple Go-ish object system built on GCC -fplan9-extensions - * - * Copyright (C) 2024 Luke T. Shumaker - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -#ifndef _LIBMISC_VCALL_H_ -#define _LIBMISC_VCALL_H_ - -#include /* for offsetof() */ - -#include - -#define VCALL(o, m, ...) \ - ({ \ - assert(o); \ - (o)->vtable->m(o __VA_OPT__(,) __VA_ARGS__); \ - }) - -#define VCALL_SELF(obj_typ, iface_typ, iface_ptr) \ - ({ \ - static_assert(_Generic(iface_ptr, iface_typ *: 1, default: 0), \ - "typeof("#iface_ptr") != "#iface_typ" *"); \ - assert(iface_ptr); \ - ((obj_typ*)(((void*)iface_ptr)-offsetof(obj_typ,iface_typ))); \ - }) - -#endif /* _LIBMISC_VCALL_H_ */ -- cgit v1.2.3-2-g168b