473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

meta-pragma

I have some code that is to compile on two different compilers.
Each compiler has a different syntax for a required #pragma
statement (OT, but the pragma's purpose is to identify the
TU's data so the linker can put it where I want it).

Currently I am writing:

#if (defined FOO_COMPILER)
# pragma FOO
#elif (defined BAR_COMPILER)
# pragma BAR
#endif

in every .c file. This would be even worse if there were more
compilers to support. I would prefer to have just one line in
every .c file, eg:

#pragma THE_PRAGMA

and in a header file:

#if (defined FOO_COMPILER)
# define THE_PRAGMA FOO
#elif (defined BAR_COMPILER)
# define THE_PRAGMA BAR
#endif
but that syntax isn't accepted. Is there some way of doing
what I want?

Nov 14 '05 #1
1 1248
"Old Wolf" <ol*****@inspire.net.nz> writes:
I would prefer to have just one line in
every .c file, eg:

#pragma THE_PRAGMA

and in a header file:

#if (defined FOO_COMPILER)
# define THE_PRAGMA FOO
#elif (defined BAR_COMPILER)
# define THE_PRAGMA BAR
#endif
but that syntax isn't accepted. Is there some way of doing
what I want?


How about this? Put
#if (defined FOO_COMPILER)
# pragma FOO
#elif (defined BAR_COMPILER)
# pragma BAR
#endif
in pragma.h, and then put
#include "pragma.h"
in every .c file at the point required.
--
"Your correction is 100% correct and 0% helpful. Well done!"
--Richard Heathfield
Nov 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian | last post by:
Hi, I'm trying to use standard meta tags in an xsl doc and using cocoon as my processor. The problem is that cocoon changes for example: <meta name="keywords" content="test, test, test" /> ...
1
by: Darren Blackley | last post by:
Hi there I have documents that I want to automatically add additional meta tags to. The documents already have some meta tags and I want to keep them all together, so I want to add my new meta tags...
19
by: Christian Hvid | last post by:
Hello groups. I have a series of applet computer games on my homepage: http://vredungmand.dk/games/erik-spillet/index.html http://vredungmand.dk/games/nohats/index.html...
24
by: Day Bird Loft | last post by:
Web Authoring | Meta-Tags The first thing to understand in regard to Meta Tags is the three most important tags placed in the head of your html documents. They are the title, description, and...
3
by: J1C | last post by:
How can I programatically add meta tags with javascript?
4
by: Jim Hammond | last post by:
After much effort, it doesn't seem possible to redirect the user to a new page after 10 seconds by using a server-side timer. I am now using the following meta statement to accomplish the same...
1
by: Maziar Aflatoun | last post by:
Hi everyone, My goal is to modify the contents of my meta tag (html refresh). However, my code adds a new instance of the meta tag at the bottom of the page. Is there a way to modify it instead...
4
by: clintonG | last post by:
Anybody know how to dynamically write the meta tags using code so they are formatted on a separate line in the HTML source? Preferred or optimal framework classes that may be used in this regard? ...
16
by: Edward | last post by:
Hi All, I am having huge problems with a very simple dotnet framework web page (www.gbab.net/ztest3.aspx) , it does NOT render correctly under Apple's Safari. The DIV's do not align amd float as...
1
by: simon2x1 | last post by:
how does each of the following meta tag below work and how it will appear or work with google <META NAME="Title" CONTENT=""> <META NAME="Description" CONTENT=""> <META NAME="Keywords"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.