title: GLSL: check if an extension is supported
body: <p>You can't use an unsupported extension, driver will return compilation error. But can you check availability of some extension directly from GLSL code? Is there something like this? </p>
  
  <pre><code>#version XXX core
  #if supported(EXT_some_extension)
  #extension EXT_some_extension: enable
  #endif
  
  ...
  </code></pre>
  
  <p><strong>UPDATE:</strong> According to <em>Nicol</em>'s <em>Bolas</em> answer. Yes, that appeared in my mind too, but for some reason, it is not working</p>
  
  <pre><code>#version 150 core
  #extension ARB_explicit_attrib_location : enable
  #ifdef ARB_explicit_attrib_location
  #define useLayout layout(location = 2)
  #else
  #define useLayout  //thats an empty space
  #endif
  
  in vec2 in_Position;
  useLayout in vec2 in_TextureCoord;
  ...
  </code></pre>
  
  <p>Macro "useLayout" is always set to empty space, but if I left only <code>#enable</code> directive without conditions it will use it (my driver supports it). Looks like extensions do not being defined, it is something else (probably?) (<code>#if defined(ARB_explicit_attrib_location)</code> does not work too)</p>