Skip to content

Commit feaab02

Browse files
committed
provide loff_t as typedef
muslc defines those, but we want a typedef instead solution copied from libgo https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593527.html
1 parent 80981f6 commit feaab02

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/EmuFs.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
#include <sstream>
1111
#include <string>
1212

13+
// muslc defines those, but we want a typedef instead
14+
#if defined(loff_t)
15+
typedef loff_t __musl_loff_t;
16+
#undef loff_t
17+
typedef __musl_loff_t loff_t;
18+
#endif
19+
1320
#include "AddressSpace.h"
1421
#include "ReplaySession.h"
1522
#include "core.h"

src/ScopedFd.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#ifndef RR_SCOPED_FD_H_
44
#define RR_SCOPED_FD_H_
55

6+
#ifndef _GNU_SOURCE
7+
#define _GNU_SOURCE
8+
#endif
69
#include <fcntl.h>
710
#include <sys/stat.h>
811
#include <sys/types.h>

src/record_syscall.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@
102102
#include "log.h"
103103
#include "util.h"
104104

105+
// muslc defines those, but we want a typedef instead
106+
#if defined(loff_t)
107+
typedef loff_t __musl_loff_t;
108+
#undef loff_t
109+
typedef __musl_loff_t loff_t;
110+
#endif
111+
105112
using namespace std;
106113

107114
#ifndef HAVE_TERMIOS2

0 commit comments

Comments
 (0)