This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] Define uid_t and gid_t in system-elf-libelf-test.c if necessary
- From: Ulf Hermann <ulf dot hermann at qt dot io>
- To: <elfutils-devel at sourceware dot org>
- Date: Thu, 4 May 2017 18:11:53 +0200
- Subject: [PATCH] Define uid_t and gid_t in system-elf-libelf-test.c if necessary
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=qt.io;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qtcompany.onmicrosoft.com; s=selector1-qt-io; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lhN9ToFbGW5Gib0eXruSVTGH9XZvwVL7mMTxNcG8m1Y=; b=JQNU5WUZREHfAzcj69FLqdnZVRVNKjVCena9vt/UZXH+1vqv/Oq01QeAmWBY7twNn1NMWR3LWzLmi7tOL/yP8ejn1d4Ug1rDxLGGOlU9b92yAu7RkGLguxQuqTZ84X+Fpv+SbjwzCqVj66qb0fUbKtXP76zgG3nIGmuQOfEVLWo=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
elf.h does include features.h which should define those. However, on
windows there is no features.h. We have the empty features.h in libgnu
that depends on config.h being included before (which we can't), and the
features.h in lib that is only available when installed in selfcontained
mode. Therefore we need a workaround here.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
tests/ChangeLog | 4 ++++
tests/system-elf-libelf-test.c | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 1a77c02..678a882 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -11,6 +11,10 @@
2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+ * system-elf-libelf-test.c: Define uid_t and gid_t on windows.
+
+2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+
* elfstrmerge.c: Use 07777 instead of ALLPERMS.
2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
diff --git a/tests/system-elf-libelf-test.c b/tests/system-elf-libelf-test.c
index 7dfe498..d9b9cd5 100644
--- a/tests/system-elf-libelf-test.c
+++ b/tests/system-elf-libelf-test.c
@@ -16,6 +16,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#define uid_t int
+#define gid_t int
+#endif
+
#include <elf.h>
#include <stddef.h>
#include "../libelf/libelf.h"
--
2.1.4