@@ -125,16 +125,54 @@ Consecutive functions should be separated with 2 empty lines in between
```cpp
voidmy_function_1()
{
<logic>
<logic>
}
voidmy_function_2()
{
<logic>
<logic>
}
```
#### Preprocessor directives
Compiler preprocessor directives should have no indentation to them, even if in the middle of indented code.
For example:
```c
caseSSL_TYPE_NONE:// SSL is not required
if(opt_require_secure_transport)
{
enumenum_vio_typetype=vio_type(vio);
#ifdef HAVE_OPENSSL
returntype!=VIO_TYPE_SSL&&
#ifndef _WIN32
type!=VIO_TYPE_SOCKET;
#else
type!=VIO_TYPE_NAMEDPIPE;
#endif
#else
#ifndef _WIN32
returntype!=VIO_TYPE_SOCKET;
#else
returntype!=VIO_TYPE_NAMEDPIPE;
#endif
#endif
}
```
Comments reflecting the original `#if` condition can be appended to `#else` / `#endif` to provide additional clarity. This can be useful for large code blocks between the start and end preprocessor directives or nested preprocessor directives.
For example:
```c
#ifndef EMBEDDED_LIBRARY
...
#else /* ! EMBEDDED_LIBRARY */
...
#endif /* ! EMBEDDED_LIBRARY */
```
### File names
File names should be lower case with underscore word separators.