summaryrefslogtreecommitdiff
path: root/test/static_if.tasklist
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* common: add STATIC_IF and STATIC_IF_NOT macrosJack Rosenthal2019-08-201-0/+9
A common pattern to use with IS_ENABLED is like this: /* * This var should only be used if CONFIG_FOO. The linker errors if * CONFIG_FOO is not defined is intentional. */ #ifdef CONFIG_FOO static #else extern #endif int some_var; The issue with this is that it leads to an over-verbose and potentially hard to read pattern, and does not have the check that CONFIG_FOO was only defined to blank. Suppose a macro like this existed: STATIC_IF(CONFIG_FOO) int some_var; ... which expands to "static" when CONFIG_FOO is defined to empty, "extern" when CONFIG_FOO is not defined, and errors when CONFIG_FOO is defined to non-empty. This CL implements that, as well as the inverse (STATIC_IF_NOT). BUG=chromium:989786 BRANCH=none TEST=provided unit tests, buildall Change-Id: Ib57aaba62bc184fda9aa782a780d5f13ba44ae88 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1731859 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>