Ticket #35: ikvm-existing.patch

File ikvm-existing.patch, 5.2 KB (added by Douglas Miles, 15 years ago)

Svn 11486 ikvm patch

  • src/org/armedbear/lisp/Complex.java

     
    304304
    305305  private static Method hypotMethod = null;
    306306  static { try {
     307    if (!IkvmSite.isIKVM())
    307308      hypotMethod =
    308309          Class.forName("java.lang.Math")
    309310          .getMethod("hypot", new Class[] { Double.TYPE, Double.TYPE });
  • src/org/armedbear/lisp/Nil.java

     
    3535
    3636public final class Nil extends Symbol
    3737{
     38  static final Nil NIL =  new Nil(PACKAGE_CL);
    3839    public Nil(Package pkg)
    3940    {
    4041        super("NIL", pkg);
  • src/org/armedbear/lisp/Lisp.java

     
    8080  // ### nil
    8181  // Constructing NIL forces the Symbol class to be loaded (since Nil extends
    8282  // Symbol).
    83   public static final LispObject NIL = new Nil(PACKAGE_CL);
     83  public static final LispObject NIL = Nil.NIL;
    8484
    8585  // We need NIL before we can call usePackage().
    8686  static
     
    10231023                              zipFileName = zipFileName.substring(1);
    10241024        }
    10251025      zipFileName = URLDecoder.decode(zipFileName, "UTF-8");
    1026                         ZipFile zipFile = new ZipFile(zipFileName);
     1026                        ZipFile zipFile = new ZipFile(IkvmSite.ikvmFile(zipFileName));
    10271027                        try
    10281028                          {
    10291029                            ZipEntry entry = zipFile.getEntry(entryName);
     
    10591059        return error(new LispError("Unable to load " + namestring));
    10601060      }
    10611061    Pathname pathname = new Pathname(namestring);
    1062     final File file = Utilities.getFile(pathname, defaultPathname);
     1062    File file = Utilities.getFile(pathname, defaultPathname);
     1063    if (file != null && !file.isFile()) {
     1064       // maybe IKVM?
     1065       file = IkvmSite.ikvmFileSafe(file);
     1066    }
    10631067    if (file != null && file.isFile())
    10641068      {
    10651069        // The .cls file exists.
     
    10871091      {
    10881092        LispObject loadTruename = Symbol.LOAD_TRUENAME.symbolValue(thread);
    10891093        String zipFileName = ((Pathname)loadTruename).getNamestring();
    1090         ZipFile zipFile = new ZipFile(zipFileName);
     1094        ZipFile zipFile = new ZipFile(IkvmSite.ikvmFile(zipFileName));
    10911095        try
    10921096          {
    10931097            ZipEntry entry = zipFile.getEntry(namestring);
  • src/org/armedbear/lisp/Load.java

     
    6464      String extension = getExtension(filename);
    6565      if (extension == null) {
    6666    // No extension specified. Try appending ".lisp" or ".abcl".
    67     File lispFile = new File(dir, filename.concat(".lisp"));
    68     File abclFile = new File(dir, filename.concat(".abcl"));
     67    File lispFile = IkvmSite.ikvmFileSafe(new File(dir, filename.concat(".lisp")));
     68    File abclFile = IkvmSite.ikvmFileSafe(new File(dir, filename.concat(".abcl")));
    6969    if (lispFile.isFile() && abclFile.isFile()) {
    7070        if (abclFile.lastModified() > lispFile.lastModified()) {
    7171      return abclFile;
     
    246246            final String dir = Site.getLispHome();
    247247            try {
    248248                if (dir != null) {
    249                     File file = new File(dir, s);
     249                    File file = IkvmSite.ikvmFileSafe(new File(dir, s));
    250250                    if (file.isFile()) {
    251251                        // File exists. For system files, we know the extension
    252252                        // will be .abcl if it is a compiled file.
     
    336336        }
    337337        return error(new LispError("File not found: " + filename));
    338338    }
    339 
     339       
    340340    // ### *fasl-version*
    341341    // internal symbol
    342342    private static final Symbol _FASL_VERSION_ =
  • src/org/armedbear/lisp/Pathname.java

     
    8888                init(s.substring(5));
    8989                return;
    9090            }
     91        } else if ("ikvmres".equals(protocol)) {
     92            String s = url.getPath();
     93            if (s != null && s.startsWith("file:")) {
     94                init(s.substring(5));
     95                return;
     96            } //Else
     97           init(s);
     98           return;
    9199        }
    92100        error(new LispError("Unsupported URL: \"" + url.toString() + '"'));
    93101    }
     
    13301338            if (originalNamestring != null && newNamestring != null) {
    13311339                final File source = new File(originalNamestring);
    13321340                final File destination = new File(newNamestring);
    1333                 if (Utilities.isPlatformWindows) {
     1341                if (Utilities.isPlatformWindows || IkvmSite.isIKVM()) {
    13341342                    if (destination.isFile())
    13351343                        destination.delete();
    13361344                }