class_docstr: Abstract base class to define the interface that must be implemented
  by real compiler classes.  Also has some utility methods used by
  several compiler classes.
  
  The basic idea behind a compiler abstraction class is that each
  instance can be used for all the compile/link steps in building a
  single project.  Thus, attributes common to all of those compile and
  link steps -- include directories, macros to define, libraries to link
  against, etc. -- are attributes of the compiler instance.  To allow for
  variability in how individual files are treated, most of those
  attributes may be varied on a per-compilation or per-link basis.
class_docstr_tok: ["Abstract","base","class","to","define","the","interface","that","must","be","implemented","by","real","compiler","classes",".","Also","has","some","utility","methods","used","by","several","compiler","classes",".","The","basic","idea","behind","a","compiler","abstraction","class","is","that","each","instance","can","be","used","for","all","the","compile\/link","steps","in","building","a","single","project",".","Thus",",","attributes","common","to","all","of","those","compile","and","link","steps","--","include","directories",",","macros","to","define",",","libraries","to","link","against",",","etc",".","--","are","attributes","of","the","compiler","instance",".","To","allow","for","variability","in","how","individual","files","are","treated",",","most","of","those","attributes","may","be","varied","on","a","per-compilation","or","per-link","basis","."]
docstr: Ensures that every element of 'definitions' is a valid macro
  definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
  nothing if all definitions are OK, raise TypeError otherwise.
docstr_tok: ["Ensures","that","every","element","of","'definitions","'","is","a","valid","macro","definition",",","ie",".","either","(","name",",","value",")","2-tuple","or","a","(","name",",",")","tuple",".","Do","nothing","if","all","definitions","are","OK",",","raise","TypeError","otherwise","."]
code: def _check_macro_definitions(self, definitions):
      """Ensures that every element of 'definitions' is a valid macro
      definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
      nothing if all definitions are OK, raise TypeError otherwise.
      """
      for defn in definitions:
          if not (
              isinstance(defn, tuple)
              and (
                  len(defn) in (1, 2)
                  and (isinstance(defn[1], str) or defn[1] is None)
              )
              and isinstance(defn[0], str)
          ):
              raise TypeError(
                  ("invalid macro definition '%s': " % defn)
                  + "must be tuple (string,), (string, string), or "
                  + "(string, None)"
              )
  
imports: import sys
  import os
  import re
  import warnings
  from .errors import CompileError, LinkError, UnknownFileError, DistutilsPlatformError, DistutilsModuleError
  from .spawn import spawn
  from .file_util import move_file
  from .dir_util import mkpath
  from ._modified import newer_group
  from .util import split_quoted, execute
  from ._log import log
label_desc: Use image node_id 5 for calling the CCompiler obj's underlying member method code with example usage: obj._check_macro_definitions(definitions) without return types