LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-26-2007, 05:20 AM   #1
sci3ntist
Member
 
Registered: Dec 2006
Distribution: Debian,Slackware,FreeBSD,CentOS,Red Hat,Windows Server 2008
Posts: 133

Rep: Reputation: 16
GCC Macros


Hi
how can i iterate over macros defined in a make file in c?
like -DMacro1 -DMacor2 ...., the number of macros s variable
or to define the in an external file then iterate over them?
Like this:
while (more_macros) {
Do_Something(curren_macro);
}
thanks
 
Old 11-27-2007, 03:16 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You don't use macros with -Dsomething. That simply defines a symbol. Do you plan to do something with the definition in an external program or in the one you compile using that makefile?

Also, note that defines are handled by the preprocessor, not the compiler, so you rather can't use while on defines.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros In C drumstick Programming 8 11-21-2005 04:37 PM
Emacs and macros pittopitto Linux - Software 1 10-22-2005 03:27 AM
vi editor macros sailu_mvn Linux - Software 6 10-12-2005 01:44 AM
Macros Twi7ch Linux - General 2 08-27-2005 09:37 PM
keystroke macros squip Programming 1 10-09-2003 12:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration