History

kconfig: add a function to get the CONFIG_ prefix

Currently, we get the CONFIG_ prefix via the CONFIG_ macro, which means the CONFIG_ prefix is hard-coded at compile time. This goes against having a run-time defined CONFIG_ prefix. Add a function that returns the CONFIG_ prefix to use (but keep the current hard-coded behavior, to be changed in a later patch). To avoid touching all the code that uses the CONFIG_ macro, we just undef it, and define it to be a call to the function.

Yann E. MORIN committed 14 years ago

Commit b341f781 parent 337a2751 file · +6 −0Browse files

Unified · Split

scripts/kconfig/lkc.h+6−0
@@ -39,6 +39,12 @@ extern "C" { · 38 unmodified lines
39#ifndef CONFIG_39#ifndef CONFIG_
40#define CONFIG_ "CONFIG_"40#define CONFIG_ "CONFIG_"
41#endif41#endif
42static inline const char *CONFIG_prefix(void)
43{
44 return CONFIG_;
45}
46#undef CONFIG_
47#define CONFIG_ CONFIG_prefix()
42 48
43#define TF_COMMAND 0x000149#define TF_COMMAND 0x0001
44#define TF_PARAM 0x000250#define TF_PARAM 0x0002

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t