2013-03-11 22:54:41

by Arve Hjønnevåg

[permalink] [raw]
Subject: [PATCH] fuse: Fix build after change to synchronize with library

__linux__ is not always defined so check __KERNEL__ as well.

Signed-off-by: Arve Hjønnevåg <[email protected]>
---
include/uapi/linux/fuse.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
index 4c43b44..fc5d400 100644
--- a/include/uapi/linux/fuse.h
+++ b/include/uapi/linux/fuse.h
@@ -95,7 +95,7 @@
#ifndef _LINUX_FUSE_H
#define _LINUX_FUSE_H

-#ifdef __linux__
+#if defined(__KERNEL__) || defined(__linux__)
#include <linux/types.h>
#else
#include <stdint.h>
--
1.8.1.3


2013-03-12 09:02:33

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH] fuse: Fix build after change to synchronize with library

On Mon, 2013-03-11 at 15:54 -0700, Arve Hjønnevåg wrote:
> __linux__ is not always defined so check __KERNEL__ as well.
>
> Signed-off-by: Arve Hjønnevåg <[email protected]>
> ---
> include/uapi/linux/fuse.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
> index 4c43b44..fc5d400 100644
> --- a/include/uapi/linux/fuse.h
> +++ b/include/uapi/linux/fuse.h
> @@ -95,7 +95,7 @@
> #ifndef _LINUX_FUSE_H
> #define _LINUX_FUSE_H
>
> -#ifdef __linux__
> +#if defined(__KERNEL__) || defined(__linux__)

Or how about just

#ifdef __KERNEL__

?

Thanks,
Miklos

2013-03-12 23:37:36

by Arve Hjønnevåg

[permalink] [raw]
Subject: Re: [PATCH] fuse: Fix build after change to synchronize with library

On Tue, Mar 12, 2013 at 2:02 AM, Miklos Szeredi <[email protected]> wrote:
> On Mon, 2013-03-11 at 15:54 -0700, Arve Hj?nnev?g wrote:
>> __linux__ is not always defined so check __KERNEL__ as well.
>>
>> Signed-off-by: Arve Hj?nnev?g <[email protected]>
>> ---
>> include/uapi/linux/fuse.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
>> index 4c43b44..fc5d400 100644
>> --- a/include/uapi/linux/fuse.h
>> +++ b/include/uapi/linux/fuse.h
>> @@ -95,7 +95,7 @@
>> #ifndef _LINUX_FUSE_H
>> #define _LINUX_FUSE_H
>>
>> -#ifdef __linux__
>> +#if defined(__KERNEL__) || defined(__linux__)
>
> Or how about just
>
> #ifdef __KERNEL__
>

I don't think that will give you the same behavior when compiling
user-space code.

--
Arve Hj?nnev?g