c - why nginx don't use basic types directly? -
the code ngx_config.h
typedef intptr_t ngx_int_t; typedef uintptr_t ngx_uint_t; typedef intptr_t ngx_flag_t;
the prototype of intptr_t int, , corresponding uintptr_t u_int.
seems sophisticated type hierarchy set nginx designer. confused why don't use basic type directly?
in fact kind of type hierarchy makes code bit sophisticated.
i know hierarchy can make easy when try modify type b change 1 line of code can lead better portability, change typedef xxtype typedef b xxtype, wonder if kind of type hierarchy on used in nginx? here clues on use staff?
what's more, can tell more benefits or tricks kind of design:)
Comments
Post a Comment