more misc fixes

Patrik Stridvall ps at leissner.se
Thu Jul 19 17:25:45 CDT 2001


> Patrik Stridvall <ps at leissner.se> writes:
> 
> > Ah. You are right, I orginally meant to add it in a
> > different file (wine/obj_base16.h perhaps) but I didn't
> > think it would matter since other 16 bit interface like
> > IStream16 and IStorage16 is in wine/obj_*.h already.
> > Perhaps they should be move out as well?
> > 
> > If so to where? wine/obj_*16.h or perhaps the DLLs 
> directories if possible?
> 
> The DLL directories definitely; and if possible in the .c file where
> they are needed, to make it clear they must not be used from the
> outside.

Ah, yes. The implementing .c file, thats an idea.
Like in dlls/lzexpand/lzexpand_main.c, I guess you mean?

> > In addition (as I hinted in 5.) requiring all non-static functions
> > to have a .h file declaration is good policy for any application
> > including Wine. Hint, if a function isn't static somebody else
> > should use it otherwise some else is wrong, ie it really should
> > be static after all.
> 
> All 16-bit API functions must be treated as if they were static. 

Well we could actually make them truely static with a little trickery
and a corrensponding change of winebuild.

Idea:

#define DECLARE_ENTRY_POINT16(module, function) \
void *module##_p##function = (void *) &function

/* After the includes */

static void Foo(void *, int);
DECLARE_ENTRY_POINT16(BAR, Foo);

/* ... */

static void Foo(void *, int)
{
  /* ... */
}

It is probably not worth the trouble though.

> They
> cannot be because of the spec file reference, but ideally no code
> should ever call a 16-bit API, it should use the corresponding 32-bit
> API. Adding prototypes and a header file is only going to encourage
> using these functions which is not what we want.

OK. So what you really what is exactly the opposite of what I tried to do?

You want all 16-bit exported function prototypes moved from the .h
files to the implementing .c file in all cases that is is possible (ie Wine
compiles without errors or warnings)?

Do you also want the types and structures moved as well?
That will often not be possible, but do you want it 
despite this in the cases where it is possible?




More information about the wine-devel mailing list