aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/utils.h
AgeCommit message (Collapse)AuthorFilesLines
2014-08-21libctrl: remove reference to bsc_replace_string()Harald Welte1-0/+7
... and rather introduce a general osmo_talloc_replace_string() to libosmocore.
2014-06-16include: Switch to #pragma once patternSylvain Munaut1-4/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-07-06utils.h: we need to include utils.h for osmo_generate_backtrace()Harald Welte1-0/+2
this causes compiler warnings in user code ever since commit 55cf02221f0654a3f48888f3b13766b671a120f0
2013-07-01misc: Fix compiler warnings about the static_assert macro with gcc 4.8Holger Hans Peter Freyther1-1/+1
The modified macro is still working on a gcc 4.7 and gcc 4.8 after the removal of the typedef and addition of the unused attribute. include/osmocom/core/msgb.h: In function ‘msgb_alloc_headroom’: include/osmocom/core/utils.h:40:51: warning: typedef ‘dummyheadroom_bigger’ locally defined but not used [-Wunused-local-typedefs] #define osmo_static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1]; ^ include/osmocom/core/msgb.h:386:2: note: in expansion of macro ‘osmo_static_assert’ osmo_static_assert(size > headroom, headroom_bigger); ^
2013-03-25utils: Use fprintf to print the assertion and generate a backtraceKaterina Barone-Adesi1-1/+2
This is changing the semantic of the assert. The regression tests now either need to check the stderr result, the exit status or print a message when all tests are completed. This is not that bad as the osmo_generate_backtrace is printing to the stdout right now.
2013-03-09utils: Introduce OSMO_ASSERT in the utils and use it in the unit testsKaterina Barone-Adesi1-0/+7
The tests should unconditionally assert, regardless of debug settings. This uses the OSMO_ prefix as it's in the global namespace.
2012-08-15utils: Change semantic of OSMO_MAX/OSMO_MIN to match semantic of a functionHolger Hans Peter Freyther1-2/+2
Add parentheses around the OSMO_MAX and OSMO_MIN macro to match the behaviour of calling a function. The current version does not evaluate to what is expected. (OSMO_MAX(3, 2) + 13) currently results in 3 and not 16.
2012-04-18doc: Fix the Doxygen section endingsSylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13utils: Add declaration back for osmo_osmo_hexdump_nospcSylvain Munaut1-0/+1
As it turns out, if a project uses the old name but without a declaration, it'll causes a segfault on 64 bits platform (because of the implicit int return type which doesn't apply since here it's a pointer). Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-10utils: Fix a bad double osmo_ prefix for osmo_hexdump_nospcSylvain Munaut1-1/+1
Hopefully no project where using them it seems Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-08-17doxygen: add doxygen module 'utils'Harald Welte1-54/+7
2011-08-16start to add doxygen documentation to libosmocore headersHarald Welte1-2/+63
2011-07-27add definition of OSMO_MIN macro, similar to OSMO_MAX0.3.5Harald Welte1-0/+1
2011-06-26add MAX() macro as OSMO_MAXHarald Welte1-0/+1
2011-05-07utils: use namespace prefix osmo_*Pablo Neira Ayuso1-7/+7
Summary of changes: s/bcd2char/osmo_bcd2char/g s/char2bcd/osmo_char2bcd/g s/hexparse/osmo_hexparse/g s/hexdump/osmo_hexdump/g s/hexdump_nospc/osmo_hexdump_nospc/g s/ubit_dump/osmo_ubit_dump/g s/static_assert/osmo_static_assert/g
2011-03-28utils: move OSMO_SNPRINT_RET() macro definition to osmocom/core/utils.hPablo Neira Ayuso1-0/+9
This is used by the logging to vty conversion functions by now, but it may be of help for other functions that plan to use snprintf().
2011-03-23include: reorganize headers file to include/osmocom/[gsm|core]0.2.0Pablo Neira Ayuso1-0/+30
This patch moves all GSM-specific definitions to include/osmocom/gsm. Moreover, the headers in include/osmocore/ have been moved to include/osmocom/core. This has been proposed by Harald Welte and Sylvain Munaunt. Tested with `make distcheck'. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>