eficompiler.h 716 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*++
  2. Copyright (c) 2016 Pete Batard <pete@akeo.ie>
  3. Module Name:
  4. eficompiler.h
  5. Abstract:
  6. Compiler specific adjustments
  7. --*/
  8. #ifdef _MSC_EXTENSIONS
  9. #define EFI_UNUSED
  10. #else
  11. #define EFI_UNUSED __attribute__((__unused__))
  12. #endif
  13. #ifdef _MSC_EXTENSIONS
  14. #define EFI_NO_TAIL_CALL
  15. #else
  16. #ifdef __clang__
  17. #define EFI_NO_TAIL_CALL __attribute__((disable_tail_calls))
  18. #else
  19. #define EFI_NO_TAIL_CALL __attribute__((optimize("no-optimize-sibling-calls")))
  20. #endif
  21. #endif
  22. #ifdef _MSC_EXTENSIONS
  23. #define ALIGN(x) __declspec(align(x))
  24. #else
  25. #define ALIGN(x) __attribute__((__aligned__(x)))
  26. #endif
  27. /* Also add a catch-all on __attribute__() for MS compilers */
  28. #ifdef _MSC_EXTENSIONS
  29. #define __attribute__(x)
  30. #endif