Viktor, Maurilio:
[Viktor]
>To give everything that's needed for HBQT,
>these must be put inside hbqt.h header, not
>hbdefs.h.
>[ Including everything in central header,
>just to satisfy some contribs, or some
>specific core parts is simple, but wrong
>solution, and quite complicated to clean
>later. ]
[Viktor]
>BTW, seeing hbdefs.h. Current method for OS/2 is wrong,
>and should be fixed.
><os2.h> should only be included when legacy types are
>enabled. This means that <os2.h> has to be manually
>#included in every source file where it's currently
>missing from, along with proper INCL_ macros needed
>in each specific source file.
>I'll fix this, but it may need more passes of fixes
>to get it completely clean.
[Maurilio]
>This takes in all #defines related to PM (OS/2 GUI), it should pose no
>harm, just a slower building (maybe even not noticeable).
>But it would be better, given that qt is a contrib, have an include
>file at the top of the qt tree which does just this or at least try to
>see if it is enough to get it going.
[Maurilio]
>you need it also when you call some Dos....() APIs to have the function
> prototype.
[Viktor]
>I know, but in every such case, it should be
>included on per-source file basis. Similar to
>how we do it now for all other OSes.
Harbour for OS/2 has been using:
#define INCL_TYPES
#define INCL_DOSEXCEPTIONS /* DOS exception values */
#define INCL_ERRORS /* DOS error values */
#define INCL_LONGLONG /* include native compiler LONGLONG
definition */
#include <os2.h>
#undef INT
#undef UINT
#define HB_DONT_DEFINE_BASIC_TYPES
and proposed change is:
#define OS2EMX_PLAIN_CHAR
#define INCL_BASE
#define INCL_PM
#include <os2.h>
#undef INT
#undef UINT
#define HB_DONT_DEFINE_BASIC_TYPES
I do not know if old or new way are right, so I requested to Maurilio to
check it
Viktor, I suggest do not apply any changes until agreement
Maurilio, do you have the whole picture ?
Do not forget this info:
(*) The thing with os2.h is that you have to specify what parts of the
API you want before including it (using the #define INCL_xxx
directives). If you do it once, all subsequent attempts to include os2.h
again (probably with a different set of INCL_xxx defines) will be
ignored by the compiler because os2.h contains a protection code that
allows to include its contents only once per every compilation unit
(.cpp file). Therefore, if your set of INCL_xxx doesn't drag in APIs
needed by some other parties involved in the compilation process there
is nothing these parties can do.
BTW, if you don't want to toss the Qt includes around in all sources,
there is one alternative solution. Just add the following to hbdefs.h
right before the line where os2.h is included:
#define OS2EMX_PLAIN_CHAR
#define INCL_BASE
#define INCL_PM
This will make sure that os2.h will drag in all the APIs it has so every
party will be eventually happy.
David Macias
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour