preprocessor


expanding a macro within a macro definition


I give up. I've been wrestling with this for hours.
we have...
//-------someFileIShouldntModify.h
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_EXTRA_SD_ENV_SETTINGS \
CONSOLE_ARG \
...
PSSERIAL1 \
"autoload=no\0" \
"bootfile=image.ub\0" \
...
"bootcmd=run netboot\0" \
...
"netboot=tftp ${netstart} image.ub && bootm\0" \
""
#include <aFileIDoControl.h>
and...
//-----aFileIDoControl.h
#define TEMP CONFIG_EXTRA_ENV_SETTINGS \
"bootcmd=run sdboot\0" \
""
#undef CONFIG_EXTRA_ENV_SETTINGS
#define CONFIG_EXTRA_ENV_SETTINGS TEMP
I want to tack on an extra string to the end of CONFIG_EXTRA_ENV_SETTINGS without otherwise changing the value, (bootcmd will be set twice). But the damn thing keeps coughing up syntax errors, because it isn't expanding either my TEMP macro or the CONFIG_EXTRA_ENV_SETTINGS macro in either of the two #define statements in aFileIDoControl.h.
I've tried wrapping my macros in function macros, various stringifications (#), and I can't get those to expand. So how do I get the damn things to expand in the define statements?

Related Links

which is more important, number of variables or subexpressions?
What is the purpose of using #define to define a constant with no value?
Name of file during compile time in Progress 4gl
Triple conditional check with ifdef in M4
How to process map data from OpenStreetMap with Java?
complex preprocessor symbol for ede project
GNU-C-preprocessing FORTRAN source to change array indices causes recursion whilst expanding macro
indirectly quoting macro in traditional mode
KMP Preprocessing Function
How to detect Apportable with preprocessor flags?
Adjust data vector to have certain variance
Pre-process Laravel 4 view
File iteration with the preprocessor
processing strings of text for neural network input
How to Set Active Target in XCode 4.5+
Preprocessor assertions in arduino

Categories

HOME
xml
scikit-learn
spark-streaming
fpga
depth
interface
apache-spark-mllib
camera
pclxl
appcelerator
access
mips
spring-session
missing-data
fosrestbundle
drop-down-menu
enterprise-architect
symbol
modbus-tcp
atlassian-stash
jmp
sigma.js
oledb
solrcloud
symbols
r-mice
roundup
custom-post-type
linked-data
bringtofront
gp
uitapgesturerecognizer
finagle
numpy-broadcasting
microsoft-metro
print-css
facebook-social-plugins
dbcontext
page-replacement
appdomain
yii2-user
flac
cubism.js
hadoop-2.7.2
iotivity
x-tag
http-status-code-401
dbamp
hadoop-partitioning
beanstalk
nio2
xenomai
include-guards
ocra
mraid
osc
actionfilterattribute
broadband
infosphere-spl
jbake
metatrader5
teaspoon
rmysql
mdichild
ignite-ui
decoupling
cfcache
getopt
spring-3
ora-06550
bin
inputmismatchexception
script#
beaker-testing
cardreader
wimax
onmousemove
kqueue
fitbounds
isa-swizzling
node-redis
expression-blend-4
jquery-tools
lr
clrstoredprocedure
tui
application-planning
movieplayer
pnrp

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App