Hacker News new | ask | show | jobs
by apaprocki 5301 days ago
We use both internally, actually. GNU gcc/g++ and IBM xlc/xlC all support doing this:

  #if defined(... all the compilers above ...)
  # define PRAGMA_ONCE _Pragma("once")
  #else
  # define PRAGMA_ONCE
  #endif
Specifically, MSVC and HP cc/aCC do not support it. Oracle cc/CC does the #ifndef/#define detection and internally does something similar to what the pragma enables in other compilers.