Sponsored Content
Full Discussion: GCC: General Macro for BSD
Top Forums Programming GCC: General Macro for BSD Post 302914403 by Corona688 on Monday 25th of August 2014 03:33:54 PM
Old 08-25-2014
You can do it like #if defined(__SOMETHING__) || defined(__SOMETHINGELSE__) || defined(__THIRDTHING__)
 

3 More Discussions You Might Find Interesting

1. BSD

for linux and BSD users interested in Unix system V/bsd

for all you unix/linux interested heres an online book for free that covers the basics of BSD SysV Unix commands and applications . giving the average linux user a perspective on the differences in context of the two operating systems and for BSD users covers material as a refernce guide. ... (0 Replies)
Discussion started by: moxxx68
0 Replies

2. Solaris

Installing gcc - recieve error message gcc : cannot execute

AIM- Install Oracle 11g on Solaris using VMWare Steps 1.Logged on as root 2.Created subfolders à /usr/local/bin & /usr/local/bin/gcc 3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD 4.Copied files from CD to /usr/local/bin/gcc 5.Terminal (root) à pkgadd -d... (8 Replies)
Discussion started by: Ackers
8 Replies

3. Programming

Make-question - redefine a macro, using another macro..?

I think there is no problem to use any macro in a new macro definishion, but I have a problem with that. I can not understand why? I have a *.mak file that inludes file with many definitions and rules. ############################################## include dstndflt.mak ... One of the... (2 Replies)
Discussion started by: alex_5161
2 Replies
__CONCAT(3)						   BSD Library Functions Manual 					       __CONCAT(3)

NAME
__CONCAT, __STRING -- argument substitution SYNOPSIS
#include <sys/cdefs.h> xy __CONCAT(x, y); const char * __STRING(x); DESCRIPTION
The __CONCAT macro makes use of the cpp(1) preprocessor to concatenate two tokens. When the macro is expanded, x and y are combined into a single token, provided that the result forms a valid token; two tokens that together do not form a valid token can not be concatenated. This is known as ``token concatenation'' or ``token pasting''. The __STRING() macro uses the conventional '#' preprocessing operator to replace the argument x with a string literal. This is also known as ``stringification''. EXAMPLES
The following two printf(3) calls produce the same output: #define Net 0x01 #define BSD 0x02 #define NetBSD "NetBSD" (void)printf("%s ", __CONCAT(Net, BSD)); (void)printf("%s%s ", __STRING(Net), __STRING(BSD)); SEE ALSO
cpp(1), cdefs(3) HISTORY
The __CONCAT() and __STRING() macros first appeared in NetBSD 1.3. CAVEATS
Many small details direct the proper use of the macros. For example, while all leading and trailing whitespace is ignored when __STRING() is used, it is undefined whether cpp(1) puts white space between the tokens when __CONCAT() is used. It can be also noted that the C preproces- sor converts all comments to whitespace before any macros are even considered. The use of either macro is discouraged in complex constructs. BSD
December 16, 2010 BSD
All times are GMT -4. The time now is 10:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy