X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FLinker.c;h=21192620c8e2e98f2c79b904f5cddb8fca58c269;hb=5892af0e08fdb890b5a0b9a64346d9f7773a6ed8;hp=3b2dd1e6a6bfc631e53175fd71cc8c554716218a;hpb=69db8adf9c151d9e997a95b09b14e2b0c740c6be;p=ghc-hetmet.git diff --git a/rts/Linker.c b/rts/Linker.c index 3b2dd1e..2119262 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -1464,7 +1464,6 @@ loadObj( char *path ) close(fd); #else /* !USE_MMAP */ - /* load the image into memory */ f = fopen(path, "rb"); if (!f) @@ -1492,10 +1491,12 @@ loadObj( char *path ) oc->image = stgMallocBytes(oc->fileSize, "loadObj(image)"); # endif - n = fread ( oc->image, 1, oc->fileSize, f ); - if (n != oc->fileSize) - barf("loadObj: error whilst reading `%s'", path); - + { + int n; + n = fread ( oc->image, 1, oc->fileSize, f ); + if (n != oc->fileSize) + barf("loadObj: error whilst reading `%s'", path); + } fclose(f); #endif /* USE_MMAP */ @@ -4673,7 +4674,7 @@ static void machoInitSymbolsWithoutUnderscore() void **p = symbolsWithoutUnderscore; __asm__ volatile(".globl _symbolsWithoutUnderscore\n.data\n_symbolsWithoutUnderscore:"); -#undef Sym +#undef SymI_NeedsProto #define SymI_NeedsProto(x) \ __asm__ volatile(".long " # x); @@ -4681,13 +4682,13 @@ static void machoInitSymbolsWithoutUnderscore() __asm__ volatile(".text"); -#undef Sym +#undef SymI_NeedsProto #define SymI_NeedsProto(x) \ ghciInsertStrHashTable("(GHCi built-in symbols)", symhash, #x, *p++); RTS_MACHO_NOUNDERLINE_SYMBOLS -#undef Sym +#undef SymI_NeedsProto } #endif