~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to ToyKeeper/tk.h

  • Committer: Selene Scriven
  • Date: 2018-12-18 21:43:52 UTC
  • mto: This revision was merged to the branch mainline in revision 397.
  • Revision ID: bzr@toykeeper.net-20181218214352-gke3b4pg3ms004ei
Reworked the config file include system so it'll include the #defined value
instead of having to hard-code a bunch of specific recognized values.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef TK_H
 
2
#define TK_H
 
3
 
 
4
/////
 
5
// tk.h
 
6
// misc tricks which need to be available before other includes,
 
7
// but which don't need to be repeated in every source file
 
8
////
 
9
 
 
10
// create a way to include files defined at the command line,
 
11
// like with "gcc -DCONFIGFILE=foo.h"
 
12
#define incfile2(s) #s
 
13
#define incfile(s) incfile2(s)
 
14
// use it like this:
 
15
//#include incfile(CONFIGFILE)
 
16
 
 
17
#endif