parameters: (self, model_object)
return_statement: return ' || '.join(ifdefs)
docstring: Generates the "defined" conditional for an #if check if |model_object|
      has platform restrictions. Returns None if there are no restrictions.
docstring_summary: Generates the "defined" conditional for an #if check if |model_object|
      has platform restrictions. Returns None if there are no restrictions.
docstring_tokens: Generates the defined conditional for an #if check if |model_object| has platform restrictions . Returns None if there are no restrictions .
function: def _GetPlatformIfdefs(self, model_object):
      """Generates the "defined" conditional for an #if check if |model_object|
      has platform restrictions. Returns None if there are no restrictions.
      """
      if model_object.platforms is None:
        return None
      ifdefs = []
      for platform in model_object.platforms:
        if platform == Platforms.CHROMEOS:
          ifdefs.append('defined(OS_CHROMEOS)')
        elif platform == Platforms.LINUX:
          ifdefs.append('(defined(OS_LINUX) && !defined(OS_CHROMEOS))')
        elif platform == Platforms.MAC:
          ifdefs.append('defined(OS_MACOSX)')
        elif platform == Platforms.WIN:
          ifdefs.append('defined(OS_WIN)')
        else:
          raise ValueError("Unsupported platform ifdef: %s" % platform.name)
      return ' || '.join(ifdefs)
function_tokens: def _GetPlatformIfdefs ( self , model_object ) : if model_object . platforms is None : return None ifdefs = [ ] for platform in model_object . platforms : if platform == Platforms . CHROMEOS : ifdefs . append ( 'defined(OS_CHROMEOS)' ) elif platform == Platforms . LINUX : ifdefs . append ( '(defined(OS_LINUX) && !defined(OS_CHROMEOS))' ) elif platform == Platforms . MAC : ifdefs . append ( 'defined(OS_MACOSX)' ) elif platform == Platforms . WIN : ifdefs . append ( 'defined(OS_WIN)' ) else : raise ValueError ( "Unsupported platform ifdef: %s" % platform . name ) return ' || ' . join ( ifdefs )