[gnome-builder/alatiera/ifdef] ide-session.c: use #ifdef instead of #if for IDE_ENABLE_TRACE




commit 17c6e6a3a9cfc000b8c58def527a3e45ff822532
Author: Jordan Petridis <jordan centricular com>
Date:   Fri Jul 9 09:57:12 2021 +0300

    ide-session.c: use #ifdef instead of #if for IDE_ENABLE_TRACE
    
    Use #ifdef instead of #if so the compiler doesn't complain
    when its undefined.
    
    ```
    ../src/libide/gui/ide-session.c: In function ‘save_state_to_disk’:
    ../src/libide/gui/ide-session.c:684:5: error: "IDE_ENABLE_TRACE" is not defined, evaluates to 0 
[-Werror=undef]
      684 | #if IDE_ENABLE_TRACE
          |     ^~~~~~~~~~~~~~~~
    cc1: some warnings being treated as errors
    ```

 src/libide/gui/ide-session.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libide/gui/ide-session.c b/src/libide/gui/ide-session.c
index 8181ee982..6267f3f0b 100644
--- a/src/libide/gui/ide-session.c
+++ b/src/libide/gui/ide-session.c
@@ -681,7 +681,7 @@ save_state_to_disk (IdeSession      *self,
   state = g_variant_ref_sink (g_variant_dict_end (&final_dict));
   bytes = g_variant_get_data_as_bytes (state);
 
-#if IDE_ENABLE_TRACE
+#ifdef IDE_ENABLE_TRACE
   {
     g_autofree char *str = g_variant_print (state, TRUE);
     IDE_TRACE_MSG ("Saving session state to %s", str);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]