# FeatStd V3.0.2

# FeatStd CMake

#### Location of generated files

Automatically generated configuration headers are generated into `CMAKE_CURRENT_BINARY_DIR/gensrc/FeatStd` (i.e in most cases `CMAKE_BINARY_DIR/FeatStd/gensrc/FeatStd`) instead of `CMAKE_BINARY_DIR/gensrc/FeatStd`. Automatic CGI-Studio includes paths have been adapted to accommodate this change.

<div class="contents" id="bkmrk-"><div class="contents"><div class="textblock">---

</div></div></div>#### Add custom config header file

New build setting FEATSTD\_CUSTOM\_CONFIG to specifiy a custom config header file that gets included on top of generated file `CMAKE_CURRENT_BINARY_DIR/gensrc/FeatStd/Config.h`. This allows to add or override global CGI system settings (e.g. macros).

Example:

`FEATSTD_CUSTOM_CONFIG="path/to/MyConfig.h"`

MyConfig.h

```
#define FEATSTD_DEBUG_ASSERT(condition) \
    if (!(condition)) { \
        FeatStd::Internal::Generic::assert((#condition), __FILE__, __LINE__, false); \
    }
```

---

# FeatStd Diagnostics

#### Debug Macros

The following macros can get overridden for custom needs:

<div class="contents" id="bkmrk-featstd_debug_break-"><div class="contents"><div class="textblock">- FEATSTD\_DEBUG\_BREAK
- FEATSTD\_DEBUG\_ASSERT
- FEATSTD\_DEBUG\_FAIL
- FEATSTD\_DEBUG\_REENTRANCE\_GUARD

</div></div></div>If these macros are not defined in custom header file the default implementation is taken, e.g. (code as in FeatStd/Diagnostics/Debug.h)

```
#if !defined(FEATSTD_DEBUG_ASSERT)              // <-- allows to override in custom header file
    #if defined(FEATSTD_DEBUG)

        <a class="code" href="http://dev.doc.cgistudio.at/APILINK/group___f_e_a_t_s_t_d___u_t_i_l_s.html#gae2fcecfbe2727007268d9e72e2335b44" title="do ... while (false) favored">FEATSTD_LINT_MACRO_WHILEFALSE</a>(FEATSTD_DEBUG_ASSERT)
        #define FEATSTD_DEBUG_ASSERT(condition) \
                do { \
                    if (!(condition)) { \
                        if (FeatStd::Diagnostics::DebugControl::Assert((#condition), \
                                                                      __FILE__, __LINE__)) { \
                            FEATSTD_OS_BREAK(); \
                                       } \
                                } \
                            FEATSTD_SUPPRESS_MSC_WARNING_FOR_NEXT_EXPRESSION(4127, while (false) accepted) \
                        } while (false)
    #else
        #define FEATSTD_DEBUG_ASSERT(condition)
    #endif
#endif
```

<div class="contents" id="bkmrk-see-also%3A-add-custom"><div class="textblock"><div class="fragment">  
</div><dl class="see"><dt>**See also:**</dt><dd><span style="color: rgb(230, 126, 35);">[Add custom config header file](https://doc316en.candera.eu/link/962#bkmrk-add-custom-config-he)</span></dd></dl></div></div>---

# FeatStd Util

#### UTF8 String Constructor

The [String](http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_string.html) class constructor now has an optional parameter, to specify whether the length of a non-null-terminated UTF8 string with multi-byte characters is given in bytes or in code-points.

---