* [PATCH] define __ prefixed version of intXY_t types
@ 2017-09-08 23:36 Khem Raj
2017-09-09 0:50 ` Eric Sandeen
2017-09-09 0:56 ` Dave Chinner
0 siblings, 2 replies; 6+ messages in thread
From: Khem Raj @ 2017-09-08 23:36 UTC (permalink / raw)
To: linux-xfs; +Cc: Khem Raj
This is required since musl does not define them
unlike glibc
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
include/linux.h | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/include/linux.h b/include/linux.h
index 9611a37f..1f6319c6 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -40,6 +40,35 @@
# undef fsxattr
#endif
+#ifndef loff_t
+#define loff_t off_t
+#endif
+#ifndef __uint8_t
+#define __uint8_t uint8_t
+#endif
+#ifndef __uint16_t
+#define __uint16_t uint16_t
+#endif
+#ifndef __uint32_t
+#define __uint32_t uint32_t
+#endif
+#ifndef __uint64_t
+#define __uint64_t uint64_t
+#endif
+
+#ifndef __int8_t
+#define __int8_t int8_t
+#endif
+#ifndef __int16_t
+#define __int16_t int16_t
+#endif
+#ifndef __int32_t
+#define __int32_t int32_t
+#endif
+#ifndef __int64_t
+#define __int64_t int64_t
+#endif
+
static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
{
return ioctl(fd, cmd, p);
--
2.14.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] define __ prefixed version of intXY_t types
2017-09-08 23:36 [PATCH] define __ prefixed version of intXY_t types Khem Raj
@ 2017-09-09 0:50 ` Eric Sandeen
2017-09-09 1:14 ` Khem Raj
2017-09-09 0:56 ` Dave Chinner
1 sibling, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2017-09-09 0:50 UTC (permalink / raw)
To: Khem Raj, linux-xfs
On 9/8/17 6:36 PM, Khem Raj wrote:
> This is required since musl does not define them
> unlike glibc
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> include/linux.h | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/include/linux.h b/include/linux.h
> index 9611a37f..1f6319c6 100644
> --- a/include/linux.h
> +++ b/include/linux.h
> @@ -40,6 +40,35 @@
> # undef fsxattr
> #endif
>
> +#ifndef loff_t
> +#define loff_t off_t
I think you should just switch to off64_t in io/copy_file_range.c,
the only user of loff_t.
None of the following double-underscore types are present in
xfsprogs since this commit:
commit 14f8b6810bd240cc58131483790a099fcf56c073
Author: Darrick J. Wong <darrick.wong@oracle.com>
Date: Fri Aug 4 16:33:51 2017 -0500
xfsprogs: remove double-underscore integer types
This is a purely mechanical patch that removes the private
__{u,}int{8,16,32,64}_t typedefs in favor of using the system
{u,}int{8,16,32,64}_t typedefs. This is the sed script used to perform
the transformation and fix the resulting whitespace and indentation
errors:
s/typedef\t__uint8_t/typedef __uint8_t\t/g
s/typedef\t__uint/typedef __uint/g
s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
s/__uint8_t\t/__uint8_t\t\t/g
s/__uint/uint/g
s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
s/__int/int/g
/^typedef.*int[0-9]*_t;$/d
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
[sandeen: fix whitespace incidentals]
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
currently on the for-next branch of xfsprogs. You might want to
carry that patch until 4.13 is released.
(and 4a492e7 xfs: remove double-underscore integer types as well)
-Eric
> +#endif
> +#ifndef __uint8_t
> +#define __uint8_t uint8_t
> +#endif
> +#ifndef __uint16_t
> +#define __uint16_t uint16_t
> +#endif
> +#ifndef __uint32_t
> +#define __uint32_t uint32_t
> +#endif
> +#ifndef __uint64_t
> +#define __uint64_t uint64_t
> +#endif
> +
> +#ifndef __int8_t
> +#define __int8_t int8_t
> +#endif
> +#ifndef __int16_t
> +#define __int16_t int16_t
> +#endif
> +#ifndef __int32_t
> +#define __int32_t int32_t
> +#endif
> +#ifndef __int64_t
> +#define __int64_t int64_t
> +#endif
> +
> static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
> {
> return ioctl(fd, cmd, p);
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] define __ prefixed version of intXY_t types
2017-09-08 23:36 [PATCH] define __ prefixed version of intXY_t types Khem Raj
2017-09-09 0:50 ` Eric Sandeen
@ 2017-09-09 0:56 ` Dave Chinner
2017-09-09 1:02 ` Dave Chinner
1 sibling, 1 reply; 6+ messages in thread
From: Dave Chinner @ 2017-09-09 0:56 UTC (permalink / raw)
To: Khem Raj; +Cc: linux-xfs
On Fri, Sep 08, 2017 at 04:36:16PM -0700, Khem Raj wrote:
> This is required since musl does not define them
> unlike glibc
[u]int*_t types are defined by the C99 standard and are supposed to
be provided by stdint.h. If musl is not providing stdint.h, then
the C99 compliant compiler should be.
What's the compilation error you're trying to fix?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] define __ prefixed version of intXY_t types
2017-09-09 0:56 ` Dave Chinner
@ 2017-09-09 1:02 ` Dave Chinner
0 siblings, 0 replies; 6+ messages in thread
From: Dave Chinner @ 2017-09-09 1:02 UTC (permalink / raw)
To: Khem Raj; +Cc: linux-xfs
On Sat, Sep 09, 2017 at 10:56:09AM +1000, Dave Chinner wrote:
> On Fri, Sep 08, 2017 at 04:36:16PM -0700, Khem Raj wrote:
> > This is required since musl does not define them
> > unlike glibc
>
> [u]int*_t types are defined by the C99 standard and are supposed to
> be provided by stdint.h. If musl is not providing stdint.h, then
> the C99 compliant compiler should be.
Sorry, ignore this, I read the defines the wrong way around. (more
coffee!)
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] define __ prefixed version of intXY_t types
2017-09-09 0:50 ` Eric Sandeen
@ 2017-09-09 1:14 ` Khem Raj
2017-09-09 2:02 ` Khem Raj
0 siblings, 1 reply; 6+ messages in thread
From: Khem Raj @ 2017-09-09 1:14 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs
On Fri, Sep 8, 2017 at 5:50 PM, Eric Sandeen <sandeen@sandeen.net> wrote:
> On 9/8/17 6:36 PM, Khem Raj wrote:
>> This is required since musl does not define them
>> unlike glibc
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>> include/linux.h | 29 +++++++++++++++++++++++++++++
>> 1 file changed, 29 insertions(+)
>>
>> diff --git a/include/linux.h b/include/linux.h
>> index 9611a37f..1f6319c6 100644
>> --- a/include/linux.h
>> +++ b/include/linux.h
>> @@ -40,6 +40,35 @@
>> # undef fsxattr
>> #endif
>>
>> +#ifndef loff_t
>> +#define loff_t off_t
>
> I think you should just switch to off64_t in io/copy_file_range.c,
> the only user of loff_t.
OK. I was just following the darwin.h lead but I will make this change in v2
>
> None of the following double-underscore types are present in
> xfsprogs since this commit:
I think it was not a complete commit. I still see issues. I will see if
I can fix them
>
> commit 14f8b6810bd240cc58131483790a099fcf56c073
> Author: Darrick J. Wong <darrick.wong@oracle.com>
> Date: Fri Aug 4 16:33:51 2017 -0500
>
> xfsprogs: remove double-underscore integer types
>
> This is a purely mechanical patch that removes the private
> __{u,}int{8,16,32,64}_t typedefs in favor of using the system
> {u,}int{8,16,32,64}_t typedefs. This is the sed script used to perform
> the transformation and fix the resulting whitespace and indentation
> errors:
>
> s/typedef\t__uint8_t/typedef __uint8_t\t/g
> s/typedef\t__uint/typedef __uint/g
> s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
> s/__uint8_t\t/__uint8_t\t\t/g
> s/__uint/uint/g
> s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
> s/__int/int/g
> /^typedef.*int[0-9]*_t;$/d
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> [sandeen: fix whitespace incidentals]
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
>
> currently on the for-next branch of xfsprogs. You might want to
> carry that patch until 4.13 is released.
>
> (and 4a492e7 xfs: remove double-underscore integer types as well)
>
> -Eric
>
>> +#endif
>> +#ifndef __uint8_t
>> +#define __uint8_t uint8_t
>> +#endif
>> +#ifndef __uint16_t
>> +#define __uint16_t uint16_t
>> +#endif
>> +#ifndef __uint32_t
>> +#define __uint32_t uint32_t
>> +#endif
>> +#ifndef __uint64_t
>> +#define __uint64_t uint64_t
>> +#endif
>> +
>> +#ifndef __int8_t
>> +#define __int8_t int8_t
>> +#endif
>> +#ifndef __int16_t
>> +#define __int16_t int16_t
>> +#endif
>> +#ifndef __int32_t
>> +#define __int32_t int32_t
>> +#endif
>> +#ifndef __int64_t
>> +#define __int64_t int64_t
>> +#endif
>> +
>> static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
>> {
>> return ioctl(fd, cmd, p);
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] define __ prefixed version of intXY_t types
2017-09-09 1:14 ` Khem Raj
@ 2017-09-09 2:02 ` Khem Raj
0 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2017-09-09 2:02 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs
On Fri, Sep 8, 2017 at 6:14 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Fri, Sep 8, 2017 at 5:50 PM, Eric Sandeen <sandeen@sandeen.net> wrote:
>> On 9/8/17 6:36 PM, Khem Raj wrote:
>>> This is required since musl does not define them
>>> unlike glibc
>>>
>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> ---
>>> include/linux.h | 29 +++++++++++++++++++++++++++++
>>> 1 file changed, 29 insertions(+)
>>>
>>> diff --git a/include/linux.h b/include/linux.h
>>> index 9611a37f..1f6319c6 100644
>>> --- a/include/linux.h
>>> +++ b/include/linux.h
>>> @@ -40,6 +40,35 @@
>>> # undef fsxattr
>>> #endif
>>>
>>> +#ifndef loff_t
>>> +#define loff_t off_t
>>
>> I think you should just switch to off64_t in io/copy_file_range.c,
>> the only user of loff_t.
>
> OK. I was just following the darwin.h lead but I will make this change in v2
>
This seems to work ok with musl, if fcntl.h is included with
-D_GNU_SOURCE which seems to be the case here so I did not do this
change.
>>
>> None of the following double-underscore types are present in
>> xfsprogs since this commit:
>
> I think it was not a complete commit. I still see issues. I will see if
> I can fix them
I sent another patch that fixes the remaining issues with __[u]int* uses
and compiles fine with musl.
>
>>
>> commit 14f8b6810bd240cc58131483790a099fcf56c073
>> Author: Darrick J. Wong <darrick.wong@oracle.com>
>> Date: Fri Aug 4 16:33:51 2017 -0500
>>
>> xfsprogs: remove double-underscore integer types
>>
>> This is a purely mechanical patch that removes the private
>> __{u,}int{8,16,32,64}_t typedefs in favor of using the system
>> {u,}int{8,16,32,64}_t typedefs. This is the sed script used to perform
>> the transformation and fix the resulting whitespace and indentation
>> errors:
>>
>> s/typedef\t__uint8_t/typedef __uint8_t\t/g
>> s/typedef\t__uint/typedef __uint/g
>> s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
>> s/__uint8_t\t/__uint8_t\t\t/g
>> s/__uint/uint/g
>> s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
>> s/__int/int/g
>> /^typedef.*int[0-9]*_t;$/d
>>
>> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
>> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
>> [sandeen: fix whitespace incidentals]
>> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
>> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
>>
>> currently on the for-next branch of xfsprogs. You might want to
>> carry that patch until 4.13 is released.
>>
>> (and 4a492e7 xfs: remove double-underscore integer types as well)
>>
>> -Eric
>>
>>> +#endif
>>> +#ifndef __uint8_t
>>> +#define __uint8_t uint8_t
>>> +#endif
>>> +#ifndef __uint16_t
>>> +#define __uint16_t uint16_t
>>> +#endif
>>> +#ifndef __uint32_t
>>> +#define __uint32_t uint32_t
>>> +#endif
>>> +#ifndef __uint64_t
>>> +#define __uint64_t uint64_t
>>> +#endif
>>> +
>>> +#ifndef __int8_t
>>> +#define __int8_t int8_t
>>> +#endif
>>> +#ifndef __int16_t
>>> +#define __int16_t int16_t
>>> +#endif
>>> +#ifndef __int32_t
>>> +#define __int32_t int32_t
>>> +#endif
>>> +#ifndef __int64_t
>>> +#define __int64_t int64_t
>>> +#endif
>>> +
>>> static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
>>> {
>>> return ioctl(fd, cmd, p);
>>>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-09-09 2:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-08 23:36 [PATCH] define __ prefixed version of intXY_t types Khem Raj
2017-09-09 0:50 ` Eric Sandeen
2017-09-09 1:14 ` Khem Raj
2017-09-09 2:02 ` Khem Raj
2017-09-09 0:56 ` Dave Chinner
2017-09-09 1:02 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox