Replying to JDLH:
The libffi Portfile changed on Sept 4, 2020 with commit 81c3c7d "libffi: Fix universal variant". As far as I can tell,
this did not changed the contents of ffi.h
.
It should have changed the contents of /opt/local/include/ffi.h to just:
#ifndef __LP64__
#include "i386-ffi.h"
#else
#include "x86_64-ffi.h"
#endif
The error you reported is the reason why I made that change now, and the reason why we had made the original equivalent change for previous libffi versions long ago (see #31459 and #25439), and it fixed the problem for me.
The error message, "unterminated conditional directive", is mentioned in several bug reports. Many of those reports point to https://github.com/Sarcasm/flycheck-irony/issues/20, where it is described as a bug in LLVM, fixed in January 2018. Maybe that fix does not propagate back to macOS 10.13 High Sierra?
No idea. There could be any number of reasons why the muniversal portgroup merger is unable to merge a file successfully. I haven't attempted to analyze why it is unable to merge ffi.h or whether the problem is the one described in the link you mentioned.