mirror of https://github.com/ericonr/purr-c.git
Fix compilation under glibc.
Some feature macros behaved differently from the ones in musl.
This commit is contained in:
parent
01eaa937fe
commit
1fc274535e
1
gemi.c
1
gemi.c
|
@ -1,3 +1,4 @@
|
||||||
|
#define _XOPEN_SOURCE /* getopt */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#define _DEFAULT_SOURCE /* MAP_ANONYMOUS */
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -11,6 +12,9 @@
|
||||||
|
|
||||||
#include "mmap_file.h"
|
#include "mmap_file.h"
|
||||||
|
|
||||||
|
const int PROT_MEM = PROT_WRITE | PROT_READ;
|
||||||
|
const int MAP_MEM = MAP_ANONYMOUS | MAP_PRIVATE;
|
||||||
|
|
||||||
bool allocate_mmap(struct mmap_file *f)
|
bool allocate_mmap(struct mmap_file *f)
|
||||||
{
|
{
|
||||||
f->data = mmap(NULL, f->size, f->prot, f->flags, -1, 0);
|
f->data = mmap(NULL, f->size, f->prot, f->flags, -1, 0);
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
#define ERROR_MMAP(file) ((file).data == MAP_FAILED || (file).data == NULL)
|
#define ERROR_MMAP(file) ((file).data == MAP_FAILED || (file).data == NULL)
|
||||||
|
|
||||||
// definitions for memory backed mappings
|
// definitions for memory backed mappings
|
||||||
#define PROT_MEM (PROT_WRITE | PROT_READ)
|
extern const int PROT_MEM;
|
||||||
#define MAP_MEM (MAP_ANONYMOUS | MAP_PRIVATE)
|
extern const int MAP_MEM;
|
||||||
|
|
||||||
// 128KiB
|
// 128KiB
|
||||||
#define OUTPUT_FILE_SIZE (128 * 1024)
|
#define OUTPUT_FILE_SIZE (128 * 1024)
|
||||||
|
|
6
purr.c
6
purr.c
|
@ -1,7 +1,9 @@
|
||||||
|
#define _XOPEN_SOURCE /* getopt */
|
||||||
|
|
||||||
#ifdef HAVE_PROG_INVOCATION
|
#ifdef HAVE_PROG_INVOCATION
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE /* program_invocation_short_name */
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif
|
#endif /* HAVE_PROG_INVOCATION */
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
Loading…
Reference in New Issue