mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-02-17 22:05:58 -05:00
Merge branch 'Torrekie-main-patch-86758' into 'main'
Add Darwin support Closes #310 See merge request wayland/wayland!380
This commit is contained in:
commit
5bbf292d4c
13 changed files with 215 additions and 18 deletions
|
|
@ -23,7 +23,26 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __APPLE__
|
||||
#define _GNU_SOURCE /* For memrchr */
|
||||
#else
|
||||
#include <string.h>
|
||||
/* No memrchr() on Darwin, borrow one from OpenBSD */
|
||||
static void *
|
||||
memrchr(const void *s, int c, size_t n)
|
||||
{
|
||||
const unsigned char *cp;
|
||||
|
||||
if (n != 0) {
|
||||
cp = (unsigned char *)s + n;
|
||||
do {
|
||||
if (*(--cp) == (unsigned char)c)
|
||||
return((void *)cp);
|
||||
} while (--n != 0);
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue