日历
网志分类
展开全部
· ***    All     ***
· ***    Mood    ***
· ***    Life    ***
· *** Technology ***
· ***     Yc     ***
· ***  Cartoon   ***
· *** Collection ***
· ***  Unsorted  ***
媒体播放器

Get the Flash Player to see this player.
SkyDrive is currently not available.

站内搜索
友情链接
· 我的歪酷 非非共享界
· 风雨妖虹
· kingbeful@csdn
· 手心的太阳@瞬间十年
· Moment@Travis
· 江南麒麟居
· εз毛线团εз
· 乌拉的neverland
· 碾过的日子 闲也陶陶
· 狡兔三窟 *^.^*
· 橄榄林的风
· 水色の街
· Powerful and delicate, Life struggling
· 阿德咖吧
· 陷阱
· 风之华
· vkobe的Neverland@@
· 白日梦已死 · 伤越夜海
· 望天
· 空の軌跡
· 没什么好东西的空间
· 心情...咖啡屋
· 随风独自凉
· Some where i belong
· .★·°双晨·故事°☆ .
· BigWorld的记事本
· *Sara's*
· 人生若只如初见
· 宠辱不惊闲看庭前花开花落·去留无意漫随天外云卷云舒
· 我思我不在
· 飞扬飘雨
· lazy的猫猫
常用链接
· [Google]
· [Google Accounts]
· [IT Items]
· [Telnet@Yanxi]
· [Wikipedia]
· [Linux Manpages]
· [Mofile.com]
· [163888.net]
· [fm.qq.com]
· [Proxy]
· [Animepaper.net]
· [FreeproxySite]
· [gonwan@fc2]
· [skydrive.live.com]
· [gonwan@lifelogger]

订阅 RSS

0109300

歪酷博客

逆さまの蝶
In this Craziness
Uncertainy
一人一人の想いを
僕らは何処かに遺せるだろうか

In this Craziness
You gave me life
一つの想いを
僕らは何処まで守れるだろうか



« 上一篇: Cross-platform Development in C/C++ (3) 下一篇: Cross-platform Development in C/C++ (5) »
丸子·酱 @ 2008-08-26 10:17

Item 16: Use Standards-Based APIs (For Example, POSIX)

   
Support for the POSIX, SVID, XPG, and BSD standards that were introduced previously mainly comes by way of the GNU C library (http://www.gnu.org/software/libc/).
    Here is a list of macros supported by GCC that correspond to the previously discussed standards:
  • _POSIX_SOURCE—Defining this enables POSIX.1 standard (IEEE Standard 1003.1) and all the ISO C facilities.
    _POSIX_SOURCE is ignored if _POSIX_C_SOURCE is defined to be to a positive integer.
  • _POSIX_C_SOURCE—Define _POSIX_C_SOURCE to be greater than or equal to 1 to include functionality from the 1990 edition of the POSIX.1 standard (IEEE Standard 1003.1-1990).
    Define _POSIX_C_SOURCE to be greater than or equal to 2 to include functionality from the 1992 edition of the POSIX.2 standard (IEEE Standard 1003.2-1992).
    Define _POSIX_C_SOURCE to be greater than or equal to 199309L, and then the functionality from the 1993 edition of the POSIX.1b standard (IEEE Standard 1003.1b-1993) is made available.
  • _BSD_SOURCE—When defined, you have access to 4.3 BSD UNIX, ISO C, POSIX.1, and POSIX.2 functionality.
    4.3 BSD definitions that conflict with POSIX.1 or POSIX.2 take precedence when this macro is defined. You must also link your application with -lbsd-compat so that the linker will resolve BSDdefined functions before searching for them in the normal C library.
  • _SVID_SOURCE—If defined, SVID-derived functionality is included, as well as that provided by ISO C, POSIX.1, POSIX.2, and X/Open standards.
  • _XOPEN_SOURCE—Defining _XOPEN_SOURCE enables functions that are defined by the X/Open Portability Guide, in addition to those functions that are enabled by the _POSIX_SOURCE and _POSIX_C_SOURCE macros.
    Defining _XOPEN_SOURCE as 500 includes _XOPEN_SOURCE functionality, and new functionality from the Single UNIX Specification, version 2.
  • _ISOC99_SOURCE—GNU libc is tracking the implementation of the new C99 standard, and by enabling the _ISOC99_SOURCE macro, you can 230 Chapter 5 Operating System Interfaces and Libraries make use of the features of this standard that have been implemented so far. Some of the features supported include C++ style comments and local variable declarations within conditional expressions (which appear within for, if, while, and switch statements). Furthermore, it prohibits explicit declarations of functions and variables that would default to int, and allows declarations of variables to occur anywhere within a block, as opposed to requiring the declarations before the first statement occurring in the block. This flag has no bearing on C++ code, as you might have guessed.
  • _GNU_SOURCE—Defining this macro brings in everything described previously: ISO C89, ISO C99, POSIX.1, POSIX.2, BSD, SVID, and X/Open, and GNU-defined extensions. Should there be any conflicts with POSIX.1 and BSD, POSIX definitions take precedence over the BSD ones. You should avoid using this macro because the use of GNU extensions is inherently nonportable.


曾经的这一天...



评论 / 个人网页 / 扔小纸条
* 昵称

已经注册过? 请登录

新用户请先注册 以便能显示头像及追踪评论回复

Email
网址
* 评论
表情
 


 

分类小组论坛
杂谈 , 娱乐、八卦 , 文学、艺术 , 体育 , 旅游、同城 , 象牙塔 , 情感 , 时尚、生活 , 星座 , 科技

请注意遵守中华人民共和国法律法规, 如威胁到本站生存, 将依法向有关部门报告, 同时本站的相关记录可能成为对您不利的证据.

相关法律法规
全国人大常委会关于维护互联网安全的决定
中华人民共和国计算机信息系统安全保护条例
中华人民共和国计算机信息网络国际联网管理暂行规定
计算机信息网络国际联网安全保护管理办法
计算机信息系统国际联网保密管理规定