parameters: (compiler, flag)
docstring: Return the flag if a flag name is supported on the
      specified compiler, otherwise None (can be used as a boolean).
      If multiple flags are passed, return the first that matches.
docstring_summary: Return the flag if a flag name is supported on the
      specified compiler, otherwise None (can be used as a boolean).
      If multiple flags are passed, return the first that matches.
docstring_tokens: Return the flag if a flag name is supported on the specified compiler otherwise None ( can be used as a boolean ) . If multiple flags are passed return the first that matches .
function: def has_flag(compiler, flag):
      """
      Return the flag if a flag name is supported on the
      specified compiler, otherwise None (can be used as a boolean).
      If multiple flags are passed, return the first that matches.
      """
  
      with tmp_chdir():
          fname = "flagcheck.cpp"
          with open(fname, "w") as f:
              # Don't trigger -Wunused-parameter.
              f.write("int main (int, char **) { return 0; }")
  
          try:
              compiler.compile([fname], extra_postargs=[flag])
          except distutils.errors.CompileError:
              return False
          return True
function_tokens: def has_flag ( compiler , flag ) : with tmp_chdir ( ) : fname = "flagcheck.cpp" with open ( fname , "w" ) as f : # Don't trigger -Wunused-parameter. f . write ( "int main (int, char **) { return 0; }" ) try : compiler . compile ( [ fname ] , extra_postargs = [ flag ] ) except distutils . errors . CompileError : return False return True