preprocessor


Save string in C preprocessor


We have following macros:
#define START(x) [...]
#define FOO(x, a, b, c) [...]
#define BAR(x, a, b, c) [...]
#define END(x) [...]
We have piece of code:
START(foobar)
FOO (foobar, 1, 2, 3)
FOO (foobar, 0.1, 0.2, 0.3)
BAR (foobar, 2, 3, 4)
END (foobar)
Can we do something to let START store foobar somewhere? To xform previous into:
START(foobar)
FOO (1, 2, 3)
FOO (0.1, 0.2, 0.3)
BAR (2, 3, 4)
END ()
(something like #define FOO(x) #define VAR x)
What about:
definition:
#define START() [...VAR...]
#define FOO(a, b, c) [...VAR...]
#define BAR(a, b, c) [...VAR...]
#define END() [...VAR...]
usage:
#define VAR foobar
START()
FOO (1, 2, 3)
FOO (0.1, 0.2, 0.3)
BAR (2, 3, 4)
END ()
#undef VAR

Related Links

I want to nest include files inside include files. Why cant I do that in Inno Setup?
Discriminating between (small) numbers and everything else in C preprocessor
Defining preprocessor symbols for CLion analyzer
Check multiple conditions at once using m4 preprocessor
XC8 warning: (107) illegal # directive “foo”
Compiling with ocamlbuild and camlp5
How not to output comments using the -C operation in mcpp
C++ Builder File Version not correct
How do you a preprocess statement for #include
Does the preprocessor pass environment variables?
YAML preprocessor / macro processor
Pre-Processing using m4
Is there a practical reason for “#if defined(X) && (X != 0)”?
How to check for presence of a directory in Inno Setup preprocessor?
What are analogs of “#ifdef”, “#ifndef”, “#else”, “#elif”, “#define”, “#undef” in D programming lnaguage?
Image pre-processing in OCR

Categories

HOME
polymer
forms
knitr
opendj
access
newrelic
rds
dojo
square
nuget-package
missing-data
mvc5
azure-container-service
arangodb
fabric.io
angular-dart
supervisor
keytool
red5
smartclient
enterprise-miner
selinux
poedit
systemtime
ember-cli
angular-routing
zxing
interpreter
bulletphysics
genexus-sd
magento-1.8
userdefaults
deltaspike
indy10
baidu-map
apiary.io
timing
css-position
typesafe-config
attributeerror
escpos
oracle-service-bus
outputcache
knime
signal-strength
httr
pom.xml
context-switch
opengl-4
jqchart
google-photos
django-1.10
smartfoxserver
parfor
seek
watch-os-2
simevents
android-wake-lock
query-by-example
design-principles
mobiledoc-kit
grgit
r-package
lazybones
jdi
morton-number
poppler
video-player
phonertc
sony-lifelog-api
skspritenode
omnifaces
node-serialport
osc
diff3
openbabel
execve
appserver
wcm
with-statement
ignite-ui
vsx
modular
route-provider
panda3d
os.system
appjs
oracle-enterprise-linux
window-decoration
predicatebuilder
ilasm
jsr286
gobject-introspection
user-tracking
mysql-error-1205
facebook-iframe
purepdf
feasibility
sun
scrubyt
firefox-3
information-management

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App