Skip to content

Commit 861be81

Browse files
committed
Fix the compilation error of IOURing futex on the Ubuntu 24.04
1 parent 8090b43 commit 861be81

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

include/swoole_iouring.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,13 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17-
#ifndef SWOOLE_SRC_SWOOLE_IOURING_H
18-
#define SWOOLE_SRC_SWOOLE_IOURING_H
17+
#pragma once
1918

2019
#include "swoole_coroutine.h"
2120

2221
#ifdef SW_USE_IOURING
2322
#include <liburing.h>
2423

25-
#ifdef HAVE_IOURING_FUTEX
26-
#ifndef FUTEX2_SIZE_U32
27-
#define FUTEX2_SIZE_U32 0x02
28-
#endif
29-
#endif
30-
3124
using swoole::Coroutine;
3225

3326
enum swIouringFlag {
@@ -99,4 +92,3 @@ class Iouring {
9992
};
10093
}; // namespace swoole
10194
#endif
102-
#endif

src/coroutine/iouring.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919

2020
#include "swoole_iouring.h"
2121

22+
#ifdef HAVE_IOURING_FUTEX
23+
#ifndef FUTEX2_SIZE_U32
24+
#define FUTEX2_SIZE_U32 0x02
25+
#endif
26+
#include <linux/futex.h>
27+
#endif
28+
2229
#ifdef SW_USE_IOURING
2330
using swoole::Coroutine;
2431

0 commit comments

Comments
 (0)