iucode-tool: fix build

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen
2022-05-03 18:45:57 +08:00
parent 6850dec6d7
commit 4b39ebcebb
2 changed files with 11 additions and 5 deletions

View File

@@ -0,0 +1,10 @@
--- a/iucode_tool.c
+++ b/iucode_tool.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
+#include <limits.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>

View File

@@ -11,7 +11,7 @@ Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
--- /dev/null
+++ b/cpuid-compat/cpuid.h
@@ -0,0 +1,17 @@
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * cpuid compatibility header to build iucode-tool on non-x86 hosts
@@ -19,10 +19,6 @@ Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
+ * Copyright (C) 2022 Sergey V. Lobanov <sergey@lobanov.in>
+ */
+
+#ifdef __APPLE__
+# include <limits.h>
+#endif
+
+static __inline int __get_cpuid (unsigned int leaf,
+ unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)