core/lib/settings: Added SETTINGS_CONF_SKIP_CONVENIENCE_FUNCS.

Unfortunately, some platforms don't properly drop unreferenced functions,
so on these broken platforms we can save a significant amount
of space by skipping the definition of the convenience functions.
This commit is contained in:
Robert Quattlebaum 2013-03-19 09:50:18 -07:00
parent 28a1e40ebd
commit ed2dd29eda
2 changed files with 14 additions and 0 deletions

View File

@ -30,6 +30,12 @@
*
*/
#ifdef SETTINGS_CONF_SKIP_CONVENIENCE_FUNCS
#undef SETTINGS_CONF_SKIP_CONVENIENCE_FUNCS
#endif
#define SETTINGS_CONF_SKIP_CONVENIENCE_FUNCS 1
#include "contiki.h"
#include "settings.h"
#include "dev/eeprom.h"

View File

@ -228,6 +228,12 @@ extern settings_status_t settings_iter_delete(settings_iter_t item);
/*****************************************************************************/
// MARK: - inline convenience functions
/* Unfortunately, some platforms don't properly drop unreferenced functions,
* so on these broken platforms we can save a significant amount
* of space by skipping the definition of the convenience functions.
*/
#if !SETTINGS_CONF_SKIP_CONVENIENCE_FUNCS
static CC_INLINE const char *
settings_get_cstr(settings_key_t key, uint8_t index, char *c_str,
settings_length_t c_str_size)
@ -357,4 +363,6 @@ settings_set_uint64(settings_key_t key, uint64_t value)
}
#endif /* __int64_t_defined */
#endif /* !SETTINGS_CONF_SKIP_CONVENIENCE_FUNCS */
#endif /* !defined(__CONTIKI_SETTINGS_H__) */