Framework support for darwin

Mike Stump mrs@apple.com
Wed Aug 13 01:18:00 GMT 2003


On Tuesday, August 12, 2003, at 12:42 PM, Neil Booth wrote:
> Devang Patel wrote:-
>
>>>> Yuk!  This is nasty.  Including the same thing and getting something
>>>> different is ... counterintuitive.
>>>
>>> I agree.  We don't need or want that functionality.
>>
>> I think, Mike is talking about sub-frameworks here. In that case
>> requirement
>> is unavoidable. However implementation is a different issue. I'll try 
>> to
>> summarize requirements for framework support.
>
> Thanks for the summary.  Could you give an example where you include
> the same thing and get something different because of this structure?

Sure, as expressed a C structs:

struct Framework1 {
	int a;
} f1;

struct Framework2 {
	int a;
} f2;

main() {
	f1.a;
	f2.a;
}

Only a person that has no clue would want the two lookups on a to 
return the same thing.  Surely, knowing C, you can understand that.  
Frameworks are identical to this:

framework1/Headers/h.h:
#include <a/a.h>

includes framework1/Frameworks/a.framework/Headers/a.h

framework2/Headers/h.h:
#include <a/a.h>

includes framework2/Frameworks/a.framework/Headers/a.h

I am not asking for review of these semantics, I don't believe they are 
negotiable.

The utility would come when two people each have a subframework, let's 
call it gzip for example.  Let's say one framework is called FontUtils, 
and the other is called X11.  Now, suppose that we want to write a 
program that uses FontUtils and X11 to implement something, and let say 
that we #include headers from both in a single file.
With technology like PCH, we tend to have large header files with the 
whole world, in every translation unit.  Not including one of them, 
isn't possible.  Renaming them, isn't possible.  They are private 
namespaces to each framework.

Ok, so where do you two want to go from here?



More information about the Gcc-patches mailing list