/*************************************** ******************************
* Author: Samson
* Date: 05/03/2012
* Test Platform:
* GNU Linux version 2.6.29.4
* GCC version 4.4.0 20090506 (Red Hat 4.4.0-4) (GCC)
**************************************** ****************************/
Check nginx recentlySource codeThe macro ngx_cdecl is included in many function definitions. For example:
Int ngx_cdecl
Main (INT argc, char * const * argv );
Void ngx_cdecl
Ngx_log_stderr (ngx_err_t err, const char * FMT ,...);
The result shows that it has a declaration. It is just a macro defined as null.
# Define ngx_cdecl
After querying the relevant information, I think different compilers on different platforms have different compilation options, it is reserved only for other platforms to have compilation options that need to be added or extended in the future.
For example, when a callback function is declared in a VC environment, _ stdcall, _ cdecl, and _ fastcall are added to the compilation options that specify the function call method on the Windows platform.
Therefore, the macro defined as null is used to reserve the definition of other options for platform porting in the future. It should be just for the convenience of transplantation.