sdl2 has a namespace pollution where <SDL.h> defines unprefixed HAVE_*
macros often used by autotools, CMake, Meson. As sdl2 now depends on
libinotify for joystick support HAVE_SYS_INOTIFY_H confuses openclonk
which itself fails to detect <sys/inotify.h>. Due to inconsistent macro
visibility and missing -linotify the build breaks. So, force-disable
inotify code as it seems to be only used by editor (e.g., reload scenarios
on changes) which since openclonk 8.0 requires Qt5.
$ rg HAVE_SYS_INOTIFY_H /usr/local/include
/usr/local/include/SDL2/SDL_config.h
223:#define HAVE_SYS_INOTIFY_H 1
$ make
[...]
-- Looking for C++ include sys/inotify.h
-- Looking for C++ include sys/inotify.h - not found
[...]
src/platform/C4FileMonitor.cpp:29:2: error: use of undeclared identifier 'fd'
fd = inotify_init1(IN_CLOEXEC);
^
src/platform/C4FileMonitor.cpp:30:6: error: use of undeclared identifier 'fd'
if (fd == -1) fd = inotify_init();
^
src/platform/C4FileMonitor.cpp:30:16: error: use of undeclared identifier 'fd'
if (fd == -1) fd = inotify_init();
^
src/platform/C4FileMonitor.cpp:31:6: error: use of undeclared identifier 'fd'
if (fd == -1) LogF("inotify_init %s", strerror(errno));
^
src/platform/C4FileMonitor.cpp:42:15: error: use of undeclared identifier 'fd'
while (close(fd) == -1 && errno == EINTR) { }
^
src/platform/C4FileMonitor.cpp:57:29: error: use of undeclared identifier 'fd'
int wd = inotify_add_watch(fd, file, IN_CREATE | IN_MODIFY | IN_MOVED_TO | IN_MOVE_SELF | IN_ONLYDIR);
^
src/platform/C4FileMonitor.cpp:60:2: error: use of undeclared identifier 'watch_descriptors'
watch_descriptors[wd] = file;
^
src/platform/C4FileMonitor.cpp:65:59: error: use of undeclared identifier 'fd'
if ((pfd->revents & pfd->events) != POLLIN || pfd->fd != fd)
^
src/platform/C4FileMonitor.cpp:66:69: error: use of undeclared identifier 'fd'
LogF("C4FileMonitor::Execute unexpectedly called %d %d %hd %hd", fd, pfd->fd, pfd->events, pfd->revents);
^
src/platform/C4FileMonitor.cpp:69:11: error: use of undeclared identifier 'fd'
if (read(fd, buf, sizeof(buf)) > 0)
^
src/platform/C4FileMonitor.cpp:71:23: error: use of undeclared identifier 'watch_descriptors'
const char * file = watch_descriptors[event->wd];
^
src/platform/C4FileMonitor.cpp:99:17: error: use of undeclared identifier 'fd'
pollfd pfd = { fd, POLLIN, 0 };
^
PR: 260885
Reported by: pkg-fallout
Submitted by: Kevin Zheng (maintainer, different commit message)
- Add PGTK to OPTIONS_DEFAULT
- Remove M17N, OTF, XFT, XIM, and XPM from OPTIONS_DEFAULT
- Eliminate X11 dependencies for pure GTK Emacs by
- removing CAIRO_IMPLIES=XFT and OTF_IMPLIES=XFT
- adding CAIRO_PREVENTS=XFT and PGTK_PREVENTS=M17N XFT XPM
- not including USES=xorg.
While here, pull in a new 2022-01-03 revision and incorporate minor
formatting changes suggested by portfmt.
Reported by: jbeich
Reviewed by: jbeich
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33714
ChangeLog:
Pre-C99 implicit int
Added more support for pre-C99 implicit int:
explain *p // pointer to int
explain *p, i // pointer to int, int
explain *a[4] // array 4 of pointer to int
explain *f() // function returning pointer to int
explain (*p) // pointer to int -- unnecessary ()
const void function parameters
const (and volatile) qualifiers for void as a function "parameter" (even via a typedef) are now correctly flagged as an error:
void f1(void); // OK
void f2(const void); // error
typedef void Void;
void f3(Void); // OK
typedef const void CVoid;
void f4(CVoid); // error
Redefinition check in C++
C++ doesn't support tentative definitions, so:
int i, i; // OK in C; error in C++
is always an error in C++ even if the types match.
Restricted pointer to non-object
A restricted pointer to a non-object, e.g., function, is now correctly flagged as an error:
int (*restrict pf)(); // error