[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/ilalink link_class.c,1.9,1.10 link_type
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/ilalink link_class.c,1.9,1.10 link_type.c,1.8,1.9 linker.h,1.23,1.24 |
Date: |
Mon, 23 Dec 2002 20:25:20 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/ilalink
In directory subversions:/tmp/cvs-serv21967/ilalink
Modified Files:
link_class.c link_type.c linker.h
Log Message:
Modify the linker to favour the struct definition in a C library
rather than the redefined version in the program (e.g. FILE, passwd).
Index: link_class.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilalink/link_class.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** link_class.c 21 Dec 2002 22:36:46 -0000 1.9
--- link_class.c 24 Dec 2002 01:25:18 -0000 1.10
***************
*** 43,46 ****
--- 43,47 ----
ILNestedInfo *nested;
ILMember *member;
+ ILLibraryFind find;
/* Convert the parent class reference */
***************
*** 133,136 ****
--- 134,146 ----
}
}
+ else if(_ILLinkerLibraryReplacement(linker, &find, classInfo))
+ {
+ /* The class is identical to one in a C library, so use that
instead */
+ if(newName)
+ {
+ ILFree(newName);
+ }
+ return 1;
+ }
else
{
***************
*** 339,342 ****
--- 349,368 ----
strcat(newName, buf);
return newName;
+ }
+
+ int _ILLinkerLibraryReplacement(ILLinker *linker, ILLibraryFind *find,
+ ILClass
*classInfo)
+ {
+ _ILLinkerFindInit(find, linker, 0);
+ if(ILClass_NestedParent(classInfo) == 0 &&
+ _ILLinkerFindClass(find, ILClass_Name(classInfo),
+ ILClass_Namespace(classInfo)))
+ {
+ if(linker->memoryModel != 0)
+ {
+ return 1;
+ }
+ }
+ return 0;
}
Index: link_type.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilalink/link_type.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** link_type.c 25 Aug 2002 05:44:43 -0000 1.8
--- link_type.c 24 Dec 2002 01:25:18 -0000 1.9
***************
*** 118,121 ****
--- 118,126 ----
}
}
+ else if(_ILLinkerLibraryReplacement(linker, find, classInfo))
+ {
+ /* A local class has been replaced with a C library class */
+ return CONVERT_REF_LIBRARY;
+ }
/* If we get here, then we assume that the global class will be
***************
*** 129,133 ****
name = _ILLinkerModuleName(linker);
}
! else if(ILClass_IsPrivate(classInfo) && linker->memoryModel != 0)
{
/* Rename the private class to prevent name clashes
--- 134,139 ----
name = _ILLinkerModuleName(linker);
}
! else if(ILClass_IsPrivate(classInfo) &&
! linker->memoryModel != 0 && !ILClassIsRef(classInfo))
{
/* Rename the private class to prevent name clashes
Index: linker.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilalink/linker.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** linker.h 25 Aug 2002 06:35:46 -0000 1.23
--- linker.h 24 Dec 2002 01:25:18 -0000 1.24
***************
*** 334,337 ****
--- 334,345 ----
char *_ILLinkerNewMemberName(ILLinker *linker, ILMember *member);
+ /*
+ * Find a library class that is identical to a specified local class.
+ * This allows us to favour the library forms of types like FILE instead
+ * of picking up the redefined version in the compiled program.
+ */
+ int _ILLinkerLibraryReplacement(ILLinker *linker, ILLibraryFind *find,
+ ILClass
*classInfo);
+
#ifdef __cplusplus
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/ilalink link_class.c,1.9,1.10 link_type.c,1.8,1.9 linker.h,1.23,1.24,
Rhys Weatherley <address@hidden> <=