T.R | Title | User | Personal Name | Date | Lines |
---|
2143.1 | Make ints.h think it's already been included | WIBBIN::NOYCE | Pulling weeds, pickin' stones | Tue Apr 08 1997 11:29 | 7 |
| Well, you could hack around it by inserting
#define __INTS_LOADED 1
before the include of pthread.h. If rpc.h left
out some of the ints that pthread.h needs, you would
have to define them yourself.
|
2143.2 | thanks | CSC32::J_HENSON | Don't get even, get ahead! | Wed Apr 09 1997 10:29 | 19 |
| >> <<< Note 2143.1 by WIBBIN::NOYCE "Pulling weeds, pickin' stones" >>>
>> -< Make ints.h think it's already been included >-
>>Well, you could hack around it by inserting
>>#define __INTS_LOADED 1
>>before the include of pthread.h. If rpc.h left
>>out some of the ints that pthread.h needs, you would
>>have to define them yourself.
I tried this. With just rpc/rpc.h and phtread.h included, inserting
__INTS_LOADED 1 before the include of pthread fixed the problem. I
don't know if this same approach might cause other problems in other
situations, though.
Thanks,
Jerry
|
2143.3 | Will look further | TLE::D_SMITH | Duane Smith -- DEC C RTL | Wed Apr 09 1997 10:41 | 19 |
| We've seen this type of problem before, but I cannot find it for the
life of me. I'll ask a former team member to dig into her memory banks
for this.
In my opinion, this is one of the weakest areas of the C language.
Prior to creating a new typedef, there is no way to determine if it is
already defined or not. There is also no way to redefine the typedef
even if it is exactly the same. Convention is leading us to using a
macro indicating that a typedef has already been done.
#ifndef __SIZE_T
# define __SIZE_T 1
typedef unsigned int size_t;
#endif
This strategy is fine when you own all the header files, but in the
RPC.H case, we do not.
Duane
|
2143.4 | | CSC32::J_HENSON | Don't get even, get ahead! | Wed Apr 09 1997 12:53 | 7 |
| >> <<< Note 2143.3 by TLE::D_SMITH "Duane Smith -- DEC C RTL" >>>
>> -< Will look further >-
I will be IPMT'ing this against UCX. I think it's an issue that will have
to resolved by ucx.
Jerry
|
2143.5 | | SPECXN::DERAMO | Dan D'Eramo | Wed Apr 09 1997 13:44 | 20 |
| > #ifndef __SIZE_T
> # define __SIZE_T 1
> typedef unsigned int size_t;
> #endif
>
> This strategy is fine when you own all the header files, but in the
> RPC.H case, we do not.
You can handle more cases with a little builtin compiler
support:
__typedef unsigned int size_t;
or
#pragma typedef unsigned int size_t;
:-)
Dan
|