deal with stricter default compile options for C

This commit is contained in:
Wolfgang Thaller 2021-02-06 15:23:15 +01:00
parent 45d5bdd137
commit 3236f3cfbf
2 changed files with 3 additions and 1 deletions

View File

@ -24,6 +24,7 @@
# endif # endif
# include <stdio.h> # include <stdio.h>
# include <string.h>
# include "hfs.h" # include "hfs.h"
# include "hcwd.h" # include "hcwd.h"

View File

@ -80,6 +80,7 @@ write_file (Elf *elf, off_t size, int change_bo, size_t shnum)
if (elf->map_address != NULL) if (elf->map_address != NULL)
{ {
#ifndef __APPLE__
/* When using mmap we want to make sure the file content is /* When using mmap we want to make sure the file content is
really there. Only using ftruncate might mean the file is really there. Only using ftruncate might mean the file is
extended, but space isn't allocated yet. This might cause a extended, but space isn't allocated yet. This might cause a
@ -100,7 +101,7 @@ write_file (Elf *elf, off_t size, int change_bo, size_t shnum)
__libelf_seterrno (ELF_E_WRITE_ERROR); __libelf_seterrno (ELF_E_WRITE_ERROR);
return -1; return -1;
} }
#endif
/* The file is mmaped. */ /* The file is mmaped. */
if ((class == ELFCLASS32 if ((class == ELFCLASS32
? __elf32_updatemmap (elf, change_bo, shnum) ? __elf32_updatemmap (elf, change_bo, shnum)