#define verboten_api(a1, a2, a3) you may not use this verboten API
Make sure they must use the header containing the verboten APIs.
GNU provides a 'deprecated' attribute. From the GCC 4.6.1 manual:
deprecated
deprecated (msg)
The deprecated attribute results in a warning if the function is used anywhere in the source file. This is useful when identifying functions that are expected to be removed in a future version of a program. The warning also includes the location of the declaration of the deprecated function, to enable users to easily find further information about why the function is deprecated, or what they should do instead. Note that the warnings only occurs for uses:
int old_fn () __attribute__ ((deprecated)); int old_fn (); int (*fn_ptr)() = old_fn;
results in a warning on line 3 but not line 2. The optional msg argument, which must be a string, will be printed in the warning if present. The deprecated attribute can also be used for variables and types (see Section 6.36 [Variable Attributes], page 341, see Section 6.37 [Type Attributes], page 350.)
Note that GCC provides options to refuse to compile code using deprecated functions.
These are compile-time checks - as opposed to run-time checks. They're probably also intrusive, unless you're willing to hack the system headers used. Also, if the competitors do not use the system header, then they might get away with using them.
Consider creating a static library that is linked with their code that defines the functions that are forbidden, but the implementation of each function is an assertion that will always fail:
int verboten_api(int x, int y, char *z) { assert("function verboten_api() called" == 0); return -1; }
Link the test programs with that library.