mirror of
https://github.com/cc65/cc65.git
synced 2024-12-29 13:31:59 +00:00
In error or warning messages, output the name of the library if this is
relevant. It's otherwise difficult to know what happens when ar65 is called from within a makefile or similar. git-svn-id: svn://svn.cc65.org/cc65/trunk@5695 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
4e0cbcf33f
commit
5cf9f585a6
@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2011, Ullrich von Bassewitz */
|
||||
/* (C) 1998-2012, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@ -41,6 +41,7 @@
|
||||
|
||||
/* ar65 */
|
||||
#include "error.h"
|
||||
#include "library.h"
|
||||
#include "objdata.h"
|
||||
#include "exports.h"
|
||||
|
||||
@ -112,9 +113,9 @@ void ExpInsert (const char* Name, const ObjData* Module)
|
||||
while (1) {
|
||||
if (strcmp (L->Name, Name) == 0) {
|
||||
/* Duplicate entry */
|
||||
Warning ("External symbol `%s' in module `%s' is duplicated in "
|
||||
"module `%s'",
|
||||
Name, L->Name, Module->Name);
|
||||
Warning ("External symbol `%s' in module `%s', library `%s' "
|
||||
"is duplicated in module `%s'",
|
||||
Name, L->Name, LibName, Module->Name);
|
||||
}
|
||||
if (L->Next == 0) {
|
||||
break;
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2011, Ullrich von Bassewitz */
|
||||
/* (C) 1998-2012, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@ -60,14 +60,16 @@
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/* Name of the library file */
|
||||
const char* LibName = 0;
|
||||
|
||||
/* File descriptor for the library file */
|
||||
FILE* NewLib = 0;
|
||||
static FILE* Lib = 0;
|
||||
static const char* LibName = 0;
|
||||
|
||||
/* The library header */
|
||||
static LibHeader Header = {
|
||||
static LibHeader Header = {
|
||||
LIB_MAGIC,
|
||||
LIB_VERSION,
|
||||
0,
|
||||
@ -99,7 +101,7 @@ static void ReadHeader (void)
|
||||
}
|
||||
Header.Flags = Read16 (Lib);
|
||||
Header.IndexOffs = Read32 (Lib);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -388,7 +390,7 @@ void LibClose (void)
|
||||
}
|
||||
if (NewLib && fclose (NewLib) != 0) {
|
||||
Error ("Problem closing temporary library file: %s", strerror (errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998 Ullrich von Bassewitz */
|
||||
/* Wacholderweg 14 */
|
||||
/* D-70597 Stuttgart */
|
||||
/* EMail: uz@musoftware.de */
|
||||
/* (C) 1998-2012, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@ -48,6 +48,9 @@
|
||||
|
||||
|
||||
|
||||
/* Name of the library file */
|
||||
extern const char* LibName;
|
||||
|
||||
/* File descriptor for the new library file */
|
||||
extern FILE* NewLib;
|
||||
|
||||
@ -73,7 +76,7 @@ unsigned long LibCopyTo (FILE* F, unsigned long Bytes);
|
||||
void LibCopyFrom (unsigned long Pos, unsigned long Bytes, FILE* F);
|
||||
/* Copy data from the library file into another file */
|
||||
|
||||
void LibClose (void);
|
||||
void LibClose (void);
|
||||
/* Write remaining data, close both files and copy the temp file to the old
|
||||
* filename
|
||||
*/
|
||||
|
@ -6,12 +6,12 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2011, Ullrich von Bassewitz */
|
||||
/* (C) 1998-2012, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
/* warranty. In no event will the authors be held liable for any damages */
|
||||
/* arising from the use of this software. */
|
||||
@ -121,7 +121,7 @@ int main (int argc, char* argv [])
|
||||
|
||||
case 'V':
|
||||
fprintf (stderr,
|
||||
"ar65 V%s - (C) Copyright 1998-2011 Ullrich von Bassewitz\n",
|
||||
"ar65 V%s - (C) Copyright 1998-2012 Ullrich von Bassewitz\n",
|
||||
GetVersionAsString ());
|
||||
break;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2011, Ullrich von Bassewitz */
|
||||
/* (C) 1998-2012, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@ -41,6 +41,7 @@
|
||||
|
||||
/* ar65 */
|
||||
#include "error.h"
|
||||
#include "library.h"
|
||||
#include "objdata.h"
|
||||
|
||||
|
||||
@ -107,7 +108,7 @@ void FreeObjData (ObjData* O)
|
||||
void ClearObjData (ObjData* O)
|
||||
/* Remove any data stored in O */
|
||||
{
|
||||
unsigned I;
|
||||
unsigned I;
|
||||
xfree (O->Name);
|
||||
O->Name = 0;
|
||||
for (I = 0; I < CollCount (&O->Strings); ++I) {
|
||||
@ -164,7 +165,7 @@ void DelObjData (const char* Module)
|
||||
}
|
||||
|
||||
/* Not found! */
|
||||
Warning ("Module `%s' not found in library", Module);
|
||||
Warning ("Module `%s' not found in library `%s'", Module, LibName);
|
||||
}
|
||||
|
||||
|
||||
|
@ -267,7 +267,8 @@ void ObjAdd (const char* Name)
|
||||
* and the external one.
|
||||
*/
|
||||
if (difftime ((time_t)O->MTime, StatBuf.st_mtime) > 0.0) {
|
||||
Warning ("Replacing module `%s' by older version", O->Name);
|
||||
Warning ("Replacing module `%s' by older version in library `%s'",
|
||||
O->Name, LibName);
|
||||
}
|
||||
|
||||
/* Free data */
|
||||
@ -312,7 +313,7 @@ void ObjExtract (const char* Name)
|
||||
|
||||
/* Bail out if the module does not exist */
|
||||
if (O == 0) {
|
||||
Error ("Module `%s' not found in library", Module);
|
||||
Error ("Module `%s' not found in library `%s'", Module, LibName);
|
||||
}
|
||||
|
||||
/* Open the output file */
|
||||
|
Loading…
Reference in New Issue
Block a user