Commit Graph

8 Commits

Author SHA1 Message Date
Simon Ser 842093bb84 Define _POSIX_C_SOURCE globally
Stop trying to maintain a per-file _POSIX_C_SOURCE. Instead,
require POSIX.1-2008 globally. A lot of core source files depend
on that already.

Some care must be taken on a few select files where we need a bit
more than POSIX. Some files need XSI extensions (_XOPEN_SOURCE) and
some files need BSD extensions (_DEFAULT_SOURCE). In both cases,
these feature test macros imply _POSIX_C_SOURCE. Make sure to not
define both these macros and _POSIX_C_SOURCE explicitly to avoid
POSIX requirement conflicts (e.g. _POSIX_C_SOURCE says POSIX.1-2001
but _XOPEN_SOURCE says POSIX.1-2008).

Additionally, there is one special case in render/vulkan/vulkan.c.
That file needs major()/minor(), and these are system-specific.
On FreeBSD, _POSIX_C_SOURCE hides system-specific symbols so we need
to make sure it's not defined for this file. On Linux, we can
explicitly include <sys/sysmacros.h> and ensure that apart from
symbols defined there the file only uses POSIX toys.
2024-02-15 15:41:12 +01:00
Simon Ser c74f89d4f8 Avoid using memcpy() to copy structs
We can just use a regular assignment instead. This is more
type-safe since there is no need to provide the struct size.

The remaining memcpy() calls perform array copies or copies from
void pointers (which may be unaligned).
2023-08-03 14:40:28 +00:00
Simon Ser aaf828d3d2 render/dmabuf: add dmabuf_import_sync_file
References: https://lore.kernel.org/dri-devel/20220506180216.2095060-1-jason@jlekstrand.net/
2022-11-28 23:50:41 +00:00
Alexander Orzechowski bd7b42eb9f dmabuf: Don't leak file descriptors on error path 2022-06-06 00:50:41 -04:00
Simon Ser 3d7aa73867 render/dmabuf: make src arg const in wlr_dmabuf_attributes_copy 2021-02-02 19:53:16 +01:00
Simon Ser 7ac2ce25e3 render/dmabuf: cleanup on wlr_dmabuf_attributes_copy error 2021-02-02 19:52:20 +01:00
Simon Ser 6dbdf5db34 render/dmabuf: add wlr_dmabuf_attributes_copy 2019-06-07 09:06:11 -04:00
emersion 21928cbe61
Merge branch 'master' into screencontent 2018-05-31 12:33:27 +01:00