Steps to reproduce:
- Download Zabbix sources or check out from repository
- Navigate to src/modules/dummy
- Comment out
- Try to build module: $ make
Tons of compilation errors.
This happens because module.h depends on zbxtypes.h, and zbxtypes.h in turn (implicitly!) depends on lots of system headers. So the only way to compile loadable module is to
But that's not the end of the story because sysinc.h includes system headers conditionally with conditional variables defined in another header(!!!) config.h which is generated by configure script. So one has to run $ ./configure before even attempting to build poor dummy module.
I think this is unacceptable. Module authors need to be quite creative to work around that and this puts extra stress on build systems and continuous integration. The only reason to
in module.h is definition of zbx_uint64_t:
My suggestion is to provide definition of zbx_uint64_t in module.h if it is used outside of Zabbix:
Since stdint.h is part of C99, this should cover most of use cases.
With explicit inclusion of necessary headers in dummy.c:
the module compiles cleanly requiring just module.h from Zabbix SVN or source tarball. Zabbix code compiles too.