opnsense-src/lib
Hiroki Sato 6501b68ffb
libcasper: Use __VA_ARGS__ for function-like macros
cap_net.h uses "#define cap_f(chan, a) f(a)" to call the conventional
service function with the first argument of cap_f() dropped for
compatibility with the environment where the casper service is
unavailable.  However, this function-like macro does not work when the
arguments contains C99 compound literals, such as f(chan, (int[]){1,2,3}).
The following is a typical example:

    error = cap_getaddrinfo(capnet, "192.168.0.1", "100",
        &(struct addrinfo){
            .ai_family = AF_INET,
            .ai_flags = AI_NUMERICHOST
    }, &res);

Using cap_f(chan, ...) and __VA_ARGS__ in C99 seems a reasonable solution
for this problem.  While there is a workaround using parenthesis around
the compound literal like f(chan, ((int[]){1,2,3})), it is not intuitive
and the above example works when the cap_net is available and f() is
defined as a function.

A possible moot point is that __VA_ARGS__ cannot control how many
arguments are passed at the macro level, and "chan" is not protected.
However, "chan" is less likely to be written in compound literal, and
the function prototype should check the remaining arguments.

Reviewed by:	oshogbo
Differential Revision:	https://reviews.freebsd.org/D45858
2025-06-13 03:04:21 +09:00
..
atf atf, kyua: Implement require.kmods. 2025-05-31 14:27:30 +02:00
clang Convert libllvm, libclang and liblldb into private shared libraries 2025-04-25 19:56:39 +02:00
csu tests: move some files to the tests package 2025-05-05 16:39:25 +01:00
geom graid.8: fix typo 2025-04-28 10:01:30 -06:00
googletest Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
lib9p Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
lib80211 net80211/regdomain: try to sort out TW 2025-04-12 16:49:39 +00:00
libalias Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libarchive libarchive: fix duplicate entry in tests Makefile 2025-06-02 14:56:05 +02:00
libauditd package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
libbe libbe: don't hardcode /tmp 2025-04-20 22:49:28 -05:00
libbearssl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libbegemot Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libblacklist Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libblocksruntime Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libbluetooth Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libbsddialog Update Makefile.depend files 2024-10-14 10:26:17 -07:00
libbsdstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libbsm package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
libbsnmp pkgbase: fix inclusion of tests in ssh, bsnmp, clibs-dev 2024-12-23 17:03:30 -05:00
libbz2 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libc include: ssp: fortify <signal.h> 2025-06-11 17:16:22 -06:00
libc++ Merge llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5 2024-11-08 17:45:31 +01:00
libc++experimental Retire MK_PROFILE infrastructure 2024-11-12 12:11:51 -05:00
libc_nonshared Retire MK_PROFILE infrastructure 2024-11-12 12:11:51 -05:00
libcalendar Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcam libcam: Include nvme opcode and status code routines from nvme_util.c 2025-06-05 21:28:38 -04:00
libcapsicum manuals: Fix "skipping end of block" .Ed errors 2024-10-03 14:49:23 -03:00
libcasper libcasper: Use __VA_ARGS__ for function-like macros 2025-06-13 03:04:21 +09:00
libcbor Update Makefile.depend files 2024-10-14 10:26:17 -07:00
libclang_rt Partially revert 6527682ab7 for llvm-based projects 2025-04-24 16:36:40 +02:00
libcom_err kerberos5, libcom_err, others: append to LDFLAGS instead of replacing 2025-04-05 14:19:57 -07:00
libcompat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcompiler_rt libgcc_s: export integer and floating point __aeabi_ symbols 2025-05-04 13:48:32 +02:00
libcrypt lib/libcrypt: reinstate CFLAGS+=-I${SRCTOP}/sys/crypto/sha2 2024-10-26 20:11:02 +02:00
libcuse Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libcxxrt src: Use gnu++17 as the default C++ standard 2025-04-11 09:53:50 -04:00
libder lib: hook libder up to the build 2025-01-01 15:11:06 -06:00
libdevctl manuals: Fix some "missing section argument" 2024-10-15 17:20:55 -03:00
libdevdctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libdevinfo libdevinfo: Avoid false positives for the root0 sentinel value 2025-01-29 10:03:59 -05:00
libdevstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libdiff diff: Nits in tests. 2024-05-20 16:27:50 +02:00
libdl _dl_iterate_phdr_locked(): fix libc and libdl 2024-11-14 06:14:05 +02:00
libdpv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libdwarf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libedit libedit: Reset WARNS 2025-04-30 15:05:00 +02:00
libefivar efivar: Kill needless sys/cdefs.h 2025-05-25 07:49:32 -06:00
libelf Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libelftc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libevent1 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libexecinfo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libexpat lib/libexpat: update build config for 2.7.1 2025-04-07 11:36:45 +08:00
libfdt libfdt: Make an internal FDT library available 2024-03-21 01:05:05 -04:00
libfetch libfetch: don't include fragments in HTTP requests 2024-08-21 12:35:27 +00:00
libfido2 Update Makefile.depend files 2024-10-14 10:26:17 -07:00
libfigpar Refactor error handling in lseek operations 2024-09-21 05:25:15 -06:00
libgcc_eh src: Use gnu++17 as the default C++ standard 2025-04-11 09:53:50 -04:00
libgcc_s libgcc_s: export integer and floating point __aeabi_ symbols 2025-05-04 13:48:32 +02:00
libgeom libgeom: Avoid fixed remappings of the devstat device 2024-08-19 16:02:59 +00:00
libgpio Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libgssapi Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libiconv_modules Retire MK_PROFILE infrastructure 2024-11-12 12:11:51 -05:00
libifconfig <net/sff8472.h>: Conditionally export table of ID names 2025-04-28 13:06:07 -04:00
libipsec libipsec: decode SADB_X_EXT_IF_HW_OFFL 2024-07-12 06:29:31 +03:00
libipt Update Makefile.depend files 2024-10-14 10:26:17 -07:00
libiscsiutil libiscsiutil: Fix header to work with C++ 2025-04-02 14:40:32 -04:00
libjail jail: Add meta and env parameters 2025-03-31 09:17:03 +00:00
libkiconv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libkldelf libkldelf: add see_local parameter to elf_lookup_symbol 2024-10-25 16:20:16 +00:00
libkvm cred: Hide internal flag CRED_FLAG_CAPMODE 2024-12-16 15:42:29 +01:00
libldns Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
liblua Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
liblutok lutok: Switch from std::auto_ptr<> to std::unique_ptr<> 2025-04-16 10:09:18 -04:00
liblzma MFV: xz 5.8.1. 2025-05-04 00:06:22 -07:00
libmagic libmagic: Unbreak for older FreeBSD releases. 2025-01-07 20:42:16 -08:00
libmd lib/libmd: reenable AVX2 SHA1 kernel 2025-06-04 12:28:03 +02:00
libmemstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libmilter Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libmixer mixer(3): Do not skip devices with no volume control 2025-02-25 13:44:49 +02:00
libmp Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libmt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libnetbsd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libnetgraph lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libnetmap Update Makefile.depend files 2024-10-14 10:26:17 -07:00
libnv libnv: add tests to verify potential overflow issues 2024-09-04 13:43:16 +02:00
libnvmf nvmf: Add NVMF_CONNECTION_STATUS ioctl 2025-01-31 15:47:58 -05:00
libomp Partially revert 6527682ab7 for llvm-based projects 2025-04-24 16:36:40 +02:00
libopenbsd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libopencsd libopencsd: Remove extra slashes 2025-02-04 14:15:37 +00:00
libpam Upgrade to OpenPAM Zingiber. 2025-05-31 14:15:55 +02:00
libpathconv manuals: Fix "missing end of block" errors 2024-10-07 15:40:58 -03:00
libpcap libpcap: Add changes missed in update to 1.10.5 2024-09-14 14:35:58 -03:00
libpe Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libpfctl libpfctl: clear out source nodes before retrieving them 2025-05-30 15:15:54 +02:00
libpjdlog lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libpmc libpmc: add more alderlake models 2025-02-25 11:35:26 -04:00
libpmcstat libpmcstat: fix pmcstat -G on older-ish -CURRENT w/ drm-kmod 2025-04-20 23:00:01 -05:00
libproc Fix proc_signame() to use sig2str() 2025-06-11 17:16:22 -06:00
libprocstat libprocstat: add knowledge about NT_PROCSTAT_KQUEUES core file section 2025-03-24 04:24:14 +02:00
libradius radlib: fix a memory leak in is_valid_request 2024-06-04 19:40:55 -07:00
libregex Update Makefile.depend files 2024-10-14 10:26:17 -07:00
librpcsec_gss Retire MK_PROFILE infrastructure 2024-11-12 12:11:51 -05:00
librpcsvc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
librss manuals: Misc syntax fixes 2024-10-08 16:13:39 -03:00
librt Update Makefile.depend files 2024-10-14 10:26:17 -07:00
librtld_db Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-07-30 12:16:36 -04:00
libsbuf lib/libsbuf/tests: reformat with clang-format 2024-12-01 20:39:52 -08:00
libsdp Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libsecureboot libsecureboot: avoid noise when looking for tust anchors 2025-04-19 12:29:30 -07:00
libsm Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsmb Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsmdb Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsmutil Update Makefile.depend files 2024-10-14 10:26:17 -07:00
libsqlite3 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libssp Update Makefile.depend files 2024-10-14 10:26:17 -07:00
libssp_nonshared Retire MK_PROFILE infrastructure 2024-11-12 12:11:51 -05:00
libstats Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libstdbuf Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libstdthreads Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsys open.2: Document the O_NAMEDATTR flag 2025-06-04 15:50:16 -07:00
libsysdecode libsysdecode: correct regexp for thr_new flags 2025-06-04 14:24:20 +03:00
libtacplus lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libtelnet Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libthr C runtime: add kernel version guards on exterrctl 2025-06-04 19:09:19 +01:00
libthread_db Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-07-30 12:16:36 -04:00
libucl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libufs add packages for libufs, libzfs 2025-05-05 16:39:25 +01:00
libugidfw Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libulog Retire MK_PROFILE infrastructure 2024-11-12 12:11:51 -05:00
libunbound unbound: Update version strings 2025-04-26 20:40:17 -07:00
libusb libusb: implement libusb_get_parent 2025-06-12 11:56:31 -05:00
libusbhid libusbhid: add missing include guards 2024-06-06 10:09:05 -04:00
libutil Search for mntopts.h globally, not locally 2025-04-22 22:51:42 +01:00
libveriexec manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
libvgl lib/libvgl/main.c: remove an extra semicolon 2024-02-02 18:35:01 -07:00
libvmmapi libvmmapi: Fix auto-loading of vmm.ko 2025-02-06 16:25:42 +00:00
libwrap Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libxo Update Makefile.depend files 2024-10-14 10:26:17 -07:00
liby Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libypclnt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libz Update Makefile.depend files 2024-10-14 10:26:17 -07:00
libzstd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
msun fix build after _types.h changes 2025-06-12 14:22:17 +01:00
ncurses build: remove the last vestiges of lint support 2025-06-06 00:55:34 +01:00
nss_tacplus nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent(). 2023-08-31 07:49:57 +00:00
ofed src: Use gnu++17 as the default C++ standard 2025-04-11 09:53:50 -04:00
tests Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile libclang_rt: Descend into libclang_rt to clean 2025-06-10 14:09:12 +00:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00