Igalia / pflua

Packet filtering in Lua
Other
313 stars 39 forks source link

pf.utils: Rename FFI struct 'timeval' to 'pflua_timeval' #152

Closed lukego closed 9 years ago

lukego commented 9 years ago

This is to make it possible to use pflua and ljsyscall at the same time. Both libraries define 'struct timeval' and this creates a conflict because LuaJIT FFI wants both definitions in the same scope.

I am not sure if this is the best way to resolve the conflict. I don't know of any LuaJIT convention along the lines of:

#ifndef TIME_H
#define TIME_H
...
#endif

I suppose that the LuaJIT ecosystem may be small enough that conflicts can be dealt with as they arise, as in this commit.

wingo commented 9 years ago

LGTM; I keep thinking there should be a better solution but this makes things better at least.