浏览代码

automatically startup if hlboot.dat found in local directory

Nicolas Cannasse 8 年之前
父节点
当前提交
9c8526b030
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      src/main.c

+ 8 - 2
src/main.c

@@ -117,8 +117,14 @@ int main(int argc, pchar *argv[]) {
 		break;
 	}
 	if( file == NULL ) {
-		printf("HL/JIT %d.%d.%d (c)2015-2016 Haxe Foundation\n  Usage : hl [--debug <port>] <file>\n",HL_VERSION>>8,(HL_VERSION>>4)&15,HL_VERSION&15);
-		return 1;
+		FILE *fchk;
+		file = PSTR("hlboot.dat");
+		fchk = pfopen(file,"rb");
+		if( fchk == NULL ) {
+			printf("HL/JIT %d.%d.%d (c)2015-2016 Haxe Foundation\n  Usage : hl [--debug <port>] <file>\n",HL_VERSION>>8,(HL_VERSION>>4)&15,HL_VERSION&15);
+			return 1;
+		}
+		fclose(fchk);
 	}
 #	ifdef HL_64
 	fprintf(stderr,"HL/JIT is currently not supported when compiled to 64 bits, use make ARCH=32 to compile to 32 bits\n");