eficompiler.h 903 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*++
  2. Copyright (c) 2016 Pete Batard <[email protected]>
  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 EFI_OPTNONE
  24. #else
  25. #ifdef __clang__
  26. #define EFI_OPTNONE __attribute__((optnone))
  27. #else
  28. #define EFI_OPTNONE __attribute__((__optimize__("0")))
  29. #endif
  30. #endif
  31. #ifdef _MSC_EXTENSIONS
  32. #define ALIGN(x) __declspec(align(x))
  33. #else
  34. #define ALIGN(x) __attribute__((__aligned__(x)))
  35. #endif
  36. /* Also add a catch-all on __attribute__() for MS compilers */
  37. #ifdef _MSC_EXTENSIONS
  38. #define __attribute__(x)
  39. #endif