summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--configure.ac2
-rw-r--r--src/arch/processor.c8
-rw-r--r--src/format/format.c8
4 files changed, 21 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index bd06002..f2e8dc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+18-02-05 Cyrille Bagard <nocbos@gmail.com>
+
+ * configure.ac:
+ * src/arch/processor.c:
+ * src/format/format.c:
+ Fix the compilation in non debug mode.
+
18-02-04 Cyrille Bagard <nocbos@gmail.com>
* src/glibext/configuration.c:
diff --git a/configure.ac b/configure.ac
index 96d05ed..d3b9f1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -166,6 +166,8 @@ AC_SUBST(CFLAGS)
if test "x$enable_debug" = "xyes"; then
DEBUG_CFLAGS="$DEBUG_CFLAGS -O0 -ggdb -gdwarf-2 -DDEBUG"
+else
+ DEBUG_CFLAGS="$DEBUG_CFLAGS -DNDEBUG"
fi
AC_SUBST(DEBUG_CFLAGS)
diff --git a/src/arch/processor.c b/src/arch/processor.c
index c08e8da..5c4f864 100644
--- a/src/arch/processor.c
+++ b/src/arch/processor.c
@@ -131,14 +131,14 @@ static void g_arch_processor_class_init(GArchProcessorClass *klass)
static void g_arch_processor_init(GArchProcessor *proc)
{
g_mutex_init(&proc->mutex);
-#ifndef DEBUG
+#ifndef NDEBUG
g_atomic_int_set(&proc->locked, 0);
#endif
proc->errors = NULL;
proc->error_count = 0;
g_mutex_init(&proc->error_mutex);
-#ifndef DEBUG
+#ifndef NDEBUG
g_atomic_int_set(&proc->error_locked, 0);
#endif
@@ -549,11 +549,15 @@ void g_arch_processor_lock_unlock_errors(GArchProcessor *proc, bool state)
if (state)
{
g_mutex_lock(&proc->error_mutex);
+#ifndef NDEBUG
g_atomic_int_set(&proc->error_locked, 1);
+#endif
}
else
{
+#ifndef NDEBUG
g_atomic_int_set(&proc->error_locked, 0);
+#endif
g_mutex_unlock(&proc->error_mutex);
}
diff --git a/src/format/format.c b/src/format/format.c
index 88367f6..89db51d 100644
--- a/src/format/format.c
+++ b/src/format/format.c
@@ -116,14 +116,14 @@ static void g_binary_format_init(GBinFormat *format)
format->info = g_preload_info_new();
g_rw_lock_init(&format->syms_lock);
-#ifndef DEBUG
+#ifndef NDEBUG
g_atomic_int_set(&format->sym_locked, 0);
#endif
format->errors = NULL;
format->error_count = 0;
g_mutex_init(&format->error_mutex);
-#ifndef DEBUG
+#ifndef NDEBUG
g_atomic_int_set(&format->error_locked, 0);
#endif
@@ -1375,11 +1375,15 @@ void g_binary_format_lock_unlock_errors(GBinFormat *format, bool state)
if (state)
{
g_mutex_lock(&format->error_mutex);
+#ifndef NDEBUG
g_atomic_int_set(&format->error_locked, 1);
+#endif
}
else
{
+#ifndef NDEBUG
g_atomic_int_set(&format->error_locked, 0);
+#endif
g_mutex_unlock(&format->error_mutex);
}