swh:1:snp:a72e953ecd624a7df6e6196bbdd05851996c5e40
Raw File
Tip revision: 35c58d62470577e75cd33c62c59e1a73d0c73a5f authored by Valentin Churavy on 09 November 2023, 19:59:02 UTC
Support multiple invariant
Tip revision: 35c58d6
libTracyClient-freebsd-elfw.patch
diff --git a/public/TracyClient.cpp b/public/TracyClient.cpp
index 77f81a4a..ebeb65c9 100644
--- a/public/TracyClient.cpp
+++ b/public/TracyClient.cpp
@@ -19,6 +19,28 @@
 #  pragma warning(push, 0)
 #endif

+#ifndef ElfW
+#  if defined(FREEBSD)
+#    if __ELF_WORD_SIZE == 32
+#      define ElfW(type) Elf32_##type
+#    else
+#      define ElfW(type) Elf64_##type
+#    endif
+#  elif defined(NETBSD) || defined(OPENBSD)
+#    if ELFSIZE == 32
+#      define ElfW(type) Elf32_##type
+#    else
+#      define ElfW(type) Elf64_##type
+#    endif
+#  else
+#    if !defined(ELF_CLASS) || ELF_CLASS == ELFCLASS32
+#      define ElfW(type) Elf32_##type
+#    else
+#      define ElfW(type) Elf64_##type
+#    endif
+#  endif
+#endif
+
 #include "common/tracy_lz4.cpp"
 #include "client/TracyProfiler.cpp"
 #include "client/TracyCallstack.cpp"
back to top