Re: [i3] Call for testing for the 4.8 release

  • From: Marcus Crestani <crestani@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
  • To: Discussions/Questions about the i3 window manager <i3-discuss@xxxxxxxxxxxxx>
  • Date: Wed, 11 Jun 2014 21:03:11 +0200

"MS" == Michael Stapelberg <michael@xxxxxxxx> writes:
MS> I want to release i3 v4.8 soon, so here is a call for testing.

On OS X, I see a ton of "macro redefined" warnings when compiling
src/log.c. The redefinitions are caused by include/queue.h that exists
as a system header /usr/include/sys/queue.h on OS X.

I've attached a patch that moves the __APPLE__ specific include of
sysctl.h below the include of i3.h. This way, the compiler considers
the redefinitions to come from a system header and does not show the
warnings. Also, types.h is no longer needed on OS X.

With this patch i3 builds cleanly and works fine for me.

--
Marcus

From 349d7b2d1b603ce1ea54e275776505bd2a980e16 Mon Sep 17 00:00:00 2001
From: Marcus Crestani <crestani@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 11 Jun 2014 20:53:22 +0200
Subject: [PATCH] Include sys/sysctl.h after i3.h to prevent redefinition
warnings caused by queue.h on OS X.

---
src/log.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/log.c b/src/log.c
index ec44f3a..1014908 100644
--- a/src/log.c
+++ b/src/log.c
@@ -21,10 +21,6 @@
#include <sys/stat.h>
#include <errno.h>
#include <pthread.h>
-#if defined(__APPLE__)
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#endif

#include "util.h"
#include "log.h"
@@ -32,6 +28,10 @@
#include "libi3.h"
#include "shmlog.h"

+#if defined(__APPLE__)
+#include <sys/sysctl.h>
+#endif
+
static bool debug_logging = false;
static bool verbose = false;
static FILE *errorfile;
--
1.6.4.2

Other related posts: