[sysprof: 1/3] Fix endianness detection when writing a frame



commit 994b0535ef36ca4027e4a8789129f028dbe3e873
Author: Laurent Bigonville <bigon bigon be>
Date:   Thu Jan 2 12:39:52 2020 +0100

    Fix endianness detection when writing a frame
    
    Properly detect endianness at compilation time
    
    This fixes the tests on big-endian machines
    
    Fix: https://gitlab.gnome.org/GNOME/sysprof/issues/7

 src/libsysprof-capture/sysprof-capture-writer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libsysprof-capture/sysprof-capture-writer.c b/src/libsysprof-capture/sysprof-capture-writer.c
index 6c9362e..956340e 100644
--- a/src/libsysprof-capture/sysprof-capture-writer.c
+++ b/src/libsysprof-capture/sysprof-capture-writer.c
@@ -499,7 +499,7 @@ sysprof_capture_writer_new_from_fd (int   fd,
 
   header->magic = SYSPROF_CAPTURE_MAGIC;
   header->version = 1;
-#ifdef G_LITTLE_ENDIAN
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
   header->little_endian = TRUE;
 #else
   header->little_endian = FALSE;


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