[openssl-dev] Testing for a type with a define in e_os2.h?

Jeffrey Walton noloader at gmail.com
Sun Mar 27 06:32:06 UTC 2016


>> noloader> I don't believe you can test for a type by using 'defined(t)'. Also
>> noloader> see http://stackoverflow.com/questions/12558538/how-can-i-check-a-certain-type-is-already-defined-in-c-compiler.
>>
>> ... unless it's defined with a macro
>
> Yeah, I kind of knew about that. But a type like ssize_t defined with
> a typedef won't pass that test. It will degenerate into:
>
>    #if defined(OPENSSL_SYS_UEFI) && /*TRUE*/
>      ...
>    #endif
>
> That brings up the thing I was wondering about. I followed the pattern
> in my diffs, but did not feel it was quite right (I might be missing
> something obvious)... Why isn't ossl_ssize_t a typedef?

I'm not finding a compelling reason to define something that's usually
typedef'd. Also see
http://programmers.stackexchange.com/questions/130679/typedefs-and-defines
and http://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c.

Does anyone know why things are done that way?

Jeff


More information about the openssl-dev mailing list