mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os.notify: fix sizeof(C.epoll_event) == 12 with tcc (was 16, while with gcc/clang it is 12)
This commit is contained in:
parent
3b420a8d7f
commit
6fcab013eb
6
thirdparty/picoev/src/picoev_epoll.c
vendored
6
thirdparty/picoev/src/picoev_epoll.c
vendored
@ -28,7 +28,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
// tcc needs the pragmas, because it does not support yet
|
||||||
|
// the __EPOLL_PACKED macro, defined to be __attribute__ ((__packed__))
|
||||||
|
#pragma pack(push, 1)
|
||||||
#include <sys/epoll.h>
|
#include <sys/epoll.h>
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "picoev.h"
|
#include "picoev.h"
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ module notify
|
|||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
|
||||||
#include <sys/epoll.h>
|
#insert "@VEXEROOT/vlib/os/notify/epoll.h"
|
||||||
|
|
||||||
struct C.epoll_event {
|
struct C.epoll_event {
|
||||||
events u32
|
events u32
|
||||||
|
6
vlib/os/notify/epoll.h
Normal file
6
vlib/os/notify/epoll.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
// NOTE: tcc does not support yet __attribute__ ((__packed__)) properly,
|
||||||
|
// so the __EPOLL_PACKED macro that /usr/include/bits/epoll.h uses does not work :-| .
|
||||||
|
// However, it *does support* the older `#pragma pack(push, 1)`
|
||||||
|
#pragma pack(push, 1)
|
||||||
|
#include <sys/epoll.h>
|
||||||
|
#pragma pack(pop)
|
Loading…
Reference in New Issue
Block a user