diff mbox

[ethtool] Fix build with musl by using more common typedefs

Message ID 1414323849-5739-2-git-send-email-paul@paulbarker.me.uk
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Paul Barker Oct. 26, 2014, 11:44 a.m. UTC
When using musl as the standard C library, type names such as '__int32_t' are
not defined. Instead we must use the more commonly defined type names such as
'int32_t', which are defined in <stdint.h>.

Signed-off-by: John Spencer <maillist-linux@barfooze.de>
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
---
 internal.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Paul Barker Nov. 13, 2014, 11:22 a.m. UTC | #1
On 26 October 2014 11:44, Paul Barker <paul@paulbarker.me.uk> wrote:
> When using musl as the standard C library, type names such as '__int32_t' are
> not defined. Instead we must use the more commonly defined type names such as
> 'int32_t', which are defined in <stdint.h>.
>
> Signed-off-by: John Spencer <maillist-linux@barfooze.de>
> Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
> ---
>  internal.h | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/internal.h b/internal.h
> index a9dfae0..262a39f 100644
> --- a/internal.h
> +++ b/internal.h
> @@ -7,6 +7,7 @@
>  #include "ethtool-config.h"
>  #endif
>  #include <stdio.h>
> +#include <stdint.h>
>  #include <stdlib.h>
>  #include <string.h>
>  #include <sys/types.h>
> @@ -17,16 +18,16 @@
>
>  /* ethtool.h expects these to be defined by <linux/types.h> */
>  #ifndef HAVE_BE_TYPES
> -typedef __uint16_t __be16;
> -typedef __uint32_t __be32;
> +typedef uint16_t __be16;
> +typedef uint32_t __be32;
>  typedef unsigned long long __be64;
>  #endif
>
>  typedef unsigned long long u64;
> -typedef __uint32_t u32;
> -typedef __uint16_t u16;
> -typedef __uint8_t u8;
> -typedef __int32_t s32;
> +typedef uint32_t u32;
> +typedef uint16_t u16;
> +typedef uint8_t u8;
> +typedef int32_t s32;
>
>  #include "ethtool-copy.h"
>  #include "net_tstamp-copy.h"
> --
> 2.1.2
>

Ping. Could you let me know if this patch is acceptable or not?

Cheers,
Ben Hutchings Dec. 14, 2014, 6:37 p.m. UTC | #2
On Sun, 2014-10-26 at 11:44 +0000, Paul Barker wrote:
> When using musl as the standard C library, type names such as '__int32_t' are
> not defined. Instead we must use the more commonly defined type names such as
> 'int32_t', which are defined in <stdint.h>.
> 
> Signed-off-by: John Spencer <maillist-linux@barfooze.de>
> Signed-off-by: Paul Barker <paul@paulbarker.me.uk>

Applied, thanks.

Ben.

> ---
>  internal.h | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/internal.h b/internal.h
> index a9dfae0..262a39f 100644
> --- a/internal.h
> +++ b/internal.h
> @@ -7,6 +7,7 @@
>  #include "ethtool-config.h"
>  #endif
>  #include <stdio.h>
> +#include <stdint.h>
>  #include <stdlib.h>
>  #include <string.h>
>  #include <sys/types.h>
> @@ -17,16 +18,16 @@
>  
>  /* ethtool.h expects these to be defined by <linux/types.h> */
>  #ifndef HAVE_BE_TYPES
> -typedef __uint16_t __be16;
> -typedef __uint32_t __be32;
> +typedef uint16_t __be16;
> +typedef uint32_t __be32;
>  typedef unsigned long long __be64;
>  #endif
>  
>  typedef unsigned long long u64;
> -typedef __uint32_t u32;
> -typedef __uint16_t u16;
> -typedef __uint8_t u8;
> -typedef __int32_t s32;
> +typedef uint32_t u32;
> +typedef uint16_t u16;
> +typedef uint8_t u8;
> +typedef int32_t s32;
>  
>  #include "ethtool-copy.h"
>  #include "net_tstamp-copy.h"
diff mbox

Patch

diff --git a/internal.h b/internal.h
index a9dfae0..262a39f 100644
--- a/internal.h
+++ b/internal.h
@@ -7,6 +7,7 @@ 
 #include "ethtool-config.h"
 #endif
 #include <stdio.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
@@ -17,16 +18,16 @@ 
 
 /* ethtool.h expects these to be defined by <linux/types.h> */
 #ifndef HAVE_BE_TYPES
-typedef __uint16_t __be16;
-typedef __uint32_t __be32;
+typedef uint16_t __be16;
+typedef uint32_t __be32;
 typedef unsigned long long __be64;
 #endif
 
 typedef unsigned long long u64;
-typedef __uint32_t u32;
-typedef __uint16_t u16;
-typedef __uint8_t u8;
-typedef __int32_t s32;
+typedef uint32_t u32;
+typedef uint16_t u16;
+typedef uint8_t u8;
+typedef int32_t s32;
 
 #include "ethtool-copy.h"
 #include "net_tstamp-copy.h"