public static void cppOutputImportDeclarations(String systemname) {
    if (systemname == null) {
      if (((SystemDefinition)(Stella.$CURRENTSYSTEMDEFINITION$.get())) == null) {
        return;
      }
      systemname = ((SystemDefinition)(Stella.$CURRENTSYSTEMDEFINITION$.get())).name;
    }
    { Object old$Currentsystemdefinition$000 = Stella.$CURRENTSYSTEMDEFINITION$.get();
      Object old$Currentsystemdefinitionsubdirectory$000 = Stella.$CURRENTSYSTEMDEFINITIONSUBDIRECTORY$.get();

      try {
        Native.setSpecial(Stella.$CURRENTSYSTEMDEFINITION$, Stella.getSystemDefinition(systemname));
        Native.setSpecial(Stella.$CURRENTSYSTEMDEFINITIONSUBDIRECTORY$, ((((SystemDefinition)(Stella.$CURRENTSYSTEMDEFINITION$.get())) != null) ? ((SystemDefinition)(Stella.$CURRENTSYSTEMDEFINITION$.get())).directory : null));
        if (((SystemDefinition)(Stella.$CURRENTSYSTEMDEFINITION$.get())) != null) {
          {
            Stella.cppOutputIncludeDirective(Stella.cppRelativizeHeaderFile(Stella.makeFileName(Stella.cppYieldSystemHeaderFileName(systemname), Stella.KWD_CPP_HEADER, true), systemname), false);
            ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println();
          }
        }
        else {
          {
            Stella.STANDARD_WARNING.nativeStream.println("Warning: Can't find a system named `" + systemname + "'");
            Stella.STANDARD_WARNING.nativeStream.println();
          }
;
        }

      } finally {
        Stella.$CURRENTSYSTEMDEFINITIONSUBDIRECTORY$.set(old$Currentsystemdefinitionsubdirectory$000);
        Stella.$CURRENTSYSTEMDEFINITION$.set(old$Currentsystemdefinition$000);
      }
    }
  }