Skip to content

Instantly share code, notes, and snippets.

@Forty-Bot
Created February 7, 2020 21:44
Show Gist options
  • Select an option

  • Save Forty-Bot/b71ecf8551d155b7651a43a16c8b5d3d to your computer and use it in GitHub Desktop.

Select an option

Save Forty-Bot/b71ecf8551d155b7651a43a16c8b5d3d to your computer and use it in GitHub Desktop.
#include "foo.h"
/* Other code */
#include "foo.h"
TEST_STATIC int foo(int x)
{
/* ... */
}
#ifndef FOO_H
#define FOO_H
#include "test.h"
TEST_STATIC int foo(int x);
#endif
#ifndef TEST_H
#define TEST_H
/* Declare something static, unless we are doing unit tests */
#ifdef CONFIG_UNIT_TEST
#define TEST_STATIC
#else
#define TEST_STATIC static
#endif
#endif /* TEST_H */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment