For discussion of Alpine Linux development and developer support

1

[alpine-devel] [PATCH] Patch to compile ipmiutil with musl

Paul Kilar
Details
Message ID
<1405010940-26034-1-git-send-email-pkilar@gmail.com>
Sender timestamp
1405010940
DKIM signature
missing
Download raw message
Patch: +33 -0
---
 testing/ipmiutil/fixups.patch | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 testing/ipmiutil/fixups.patch

diff --git a/testing/ipmiutil/fixups.patch b/testing/ipmiutil/fixups.patch
new file mode 100644
index 0000000..dea7ada
--- /dev/null
+++ b/testing/ipmiutil/fixups.patch
@@ -0,0 +1,33 @@
+--- a/util/imb_api.h
+@@ -49,8 +49,8 @@
+ /* DOS defines wchar_t in stdlib.h */
+ #else 
+  // defined(LINUX) | defined(SOLARIS)
+-#ifndef _WCHAR_T
+-#define _WCHAR_T
++#ifndef __DEFINED_wchar_t
++#define __DEFINED_wchar_t
+ typedef long    wchar_t;
+ #endif
+ #endif
+--- a/util/mem_if.c
+@@ -65,6 +65,7 @@
+ #include <sys/param.h>
+ #include <sys/mman.h>
+ #include <sys/ioctl.h>
++#include <linux/param.h>
+ #endif
+ #if defined(SOLARIS) || defined(BSD)
+ #define EXEC_PAGESIZE     4096
+--- a/util/ipmimv.c
+@@ -62,6 +62,7 @@
+ #include <time.h>
+ #include <errno.h>
+ #include <sys/ioctl.h>
++#include <sys/select.h>
+ #if defined(MACOS)
+ #include <sys/time.h>
+ #else
-- 
2.0.0



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20140711141516.35a3e448@ncopa-desktop.alpinelinux.org>
In-Reply-To
<1405010940-26034-1-git-send-email-pkilar@gmail.com> (view parent)
Sender timestamp
1405080916
DKIM signature
missing
Download raw message
On Thu, 10 Jul 2014 12:49:00 -0400
Paul Kilar <pkilar@gmail.com> wrote:


nice!

I get compile error on x86_64 though:
ipmiutil.c:77:2: warning: (near initialization for 'subcmds[6].desc') [enabled by default]
mv -f .deps/ipmiutil.Tpo .deps/ipmiutil.Po
In file included from igetevent.c:135:0:
imb_api.h:54:14: error: conflicting types for 'wchar_t'
 typedef long    wchar_t;
              ^
In file included from /usr/include/stdlib.h:19:0,
                 from igetevent.c:109:
/usr/include/bits/alltypes.h:18:13: note: previous declaration of 'wchar_t' was here
 typedef int wchar_t;
             ^


> ---
>  testing/ipmiutil/fixups.patch | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
>  create mode 100644 testing/ipmiutil/fixups.patch
> 
> diff --git a/testing/ipmiutil/fixups.patch b/testing/ipmiutil/fixups.patch
> new file mode 100644
> index 0000000..dea7ada
> --- /dev/null
> +++ b/testing/ipmiutil/fixups.patch
> @@ -0,0 +1,33 @@
> +--- a/util/imb_api.h
> ++++ b/util/imb_api.h
> +@@ -49,8 +49,8 @@
> + /* DOS defines wchar_t in stdlib.h */
> + #else 
> +  // defined(LINUX) | defined(SOLARIS)
> +-#ifndef _WCHAR_T
> +-#define _WCHAR_T
> ++#ifndef __DEFINED_wchar_t
> ++#define __DEFINED_wchar_t
> + typedef long    wchar_t;
> + #endif
> + #endif

It looks like wchar_t is defined in standard C (since C90 according
http://en.wikipedia.org/wiki/Wide_character#C.2FC.2B.2B) so maybe we
can just remove the #else clause that typedef wchar_t?

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---