diff mbox series

FreeBSD: #include for device ID, major, minor

Message ID 0F7BA11F-EB69-4F06-A433-C20B69A7094F@siemens.com
State Accepted
Headers show
Series FreeBSD: #include for device ID, major, minor | expand

Commit Message

Storm, Christian Jan. 25, 2024, 7:55 p.m. UTC
On Linux, <sys/sysmacros.h> provides
    unsigned int major(dev_t dev);
    unsigned int minor(dev_t dev);
and <sys/types.h> provides
    typedef ... dev_t;

On FreeBSD, <sys/types.h> also provides <sys/sysmacros.h>'s
definitions.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 corelib/lua_interface.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Stefano Babic Jan. 26, 2024, 9:26 a.m. UTC | #1
On 25.01.24 20:55, 'Storm, Christian' via swupdate wrote:
> On Linux, <sys/sysmacros.h> provides
>      unsigned int major(dev_t dev);
>      unsigned int minor(dev_t dev);
> and <sys/types.h> provides
>      typedef ... dev_t;
> 
> On FreeBSD, <sys/types.h> also provides <sys/sysmacros.h>'s
> definitions.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>   corelib/lua_interface.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c
> index af7b5548..de3b8702 100644
> --- a/corelib/lua_interface.c
> +++ b/corelib/lua_interface.c
> @@ -12,7 +12,10 @@
>   #include <errno.h>
>   #include <time.h>
>   #include <sys/stat.h>
> +#if defined(__linux__)
>   #include <sys/sysmacros.h>
> +#endif
> +#include <sys/types.h>
>   
>   #include "lua.h"
>   #include "lauxlib.h"

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c
index af7b5548..de3b8702 100644
--- a/corelib/lua_interface.c
+++ b/corelib/lua_interface.c
@@ -12,7 +12,10 @@ 
 #include <errno.h>
 #include <time.h>
 #include <sys/stat.h>
+#if defined(__linux__)
 #include <sys/sysmacros.h>
+#endif
+#include <sys/types.h>
 
 #include "lua.h"
 #include "lauxlib.h"