summaryrefslogtreecommitdiff
path: root/lib/compiler.h
AgeCommit message (Collapse)Author
2020-03-29lib: prepare for plugin-based frr_format checkDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-09-03lib: add some macro helpersDavid Lamparter
Macro soup, now with 50% more macros. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-07-28lib: fix prefix_cmp() return valuesDavid Lamparter
OMGWTFBBQ Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13Merge pull request #4509 from opensourcerouting/spanish-intquisitionQuentin Young
lib: make printfrr int64_t usable
2019-06-12lib: make "%Ld" work for int64_tDavid Lamparter
... without compiler plugins. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-11lib: const-unaware container_of for C++David Lamparter
This version of container_of() should work on C++, by ditching the unavailable builtins (at the cost of no longer checking for "const" violations.) Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-06lib: add OPTIMIZE + assume() to compiler.hDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-03lib/printf: rename & private __find_argumentsDavid Lamparter
These are internal to printf(), and symbols starting with __ are reserved for the compiler/libc. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-05-21lib/table: remove nonsensical const, add pureDavid Lamparter
Passing the struct route_table *ptr as const doesn't really help; if anything it semantically would imply that the returned route_node is const too since constness should propagate (but it doesn't in C.) The right thing to do here - which actually helps the compiler optimize the code too - is to tag functions with __attribute__((pure)). The compiler does this automatically if it has the function body (and the body of all called functions) available. That should cover most "static inline" functions in headers, as well as functions in the same file. However, this doesn't work (at least without LTO) for extern functions. Hence, add "ext_pure" for this case. (Built-in "extern" to make lines shorter.) Signed-off-by: David Lamparter <equinox@diac24.net>
2019-04-27lib: atomlist & atomsortDavid Lamparter
These two are lock-free linked list implementations, the plain one is primarily intended for queues while the sorted one is for general data storage. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-04-18lib: move/redo some macrosDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-11lib: add extern "C" {} blocks to all libfrr headersRenato Westphal
These are necessary to use functions defined in these headers from C++. Signed-off-by: David Lamparter <equinox@diac24.net> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-21build: wrap "fallthrough" attrDavid Lamparter
This generates a warning on gcc versions before 7.0. Signed-off-by: David Lamparter <equinox@diac24.net>
2018-07-19lib/compiler.h: Always define CPP_NOTICEChristian Franke
On old compilers CPP_NOTICE should be a macro evaluating to an empty statement, instead of being undefined. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-08-24lib: split off compiler magic into its own fileDavid Lamparter
Also make timed notices available via CONFDATE. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>