怎么写平台相关代码整理
来源:互联网 发布:课观教育 知乎 编辑:程序博客网 时间:2024/05/02 08:21
How do i include different headers based on my OS?
http://stackoverflow.com/questions/6115711/how-do-i-include-different-headers-based-on-my-os
with preprocessor:
#ifdef _SUNOS//code#elseif _LINUX//code#elseif _HPUX//code#elseif _WIN32//code#else#error OS not supported#endif
What is the recommended way to organize platform specific code in C++?
http://stackoverflow.com/questions/12886575/what-is-the-recommended-way-to-organize-platform-specific-code-in-c
- Stick to standards defined by C++ ISO specifications.
- Use PLATFORM independent libraries (like Boost and Qt and Fltk)
Make sure you don't use COMPILER specific extensions, or atleast stick to 1 SINGLE compiler(recommended: G++ which is cross platform)
Follow these first. Patterns are but means of organising code. Standard patterns allowed by a language theoretically remain the same across all platforms, so that shouldn't be a part of the problem
Use #ifdef MACROS to code platform specific path to files, platform specific libraries for networking etc
- 怎么写平台相关代码整理
- 代码怎么写
- Fragment 代码怎么写
- 代码注释怎么写
- JDBC 相关代码整理
- DataTable相关代码整理
- 代码注释应该怎么写
- jQuery代码怎么写更好
- Junit测试代码怎么写
- 20.2 平台相关代码结构
- Cocos2dx IOS平台相关代码
- 怎么才算是好代码 MindJet整理
- 代码生成器怎么写(.NET)
- 用按钮调用jsp代码怎么写?
- 用按钮调用jsp代码怎么写?
- 怎么写可读性强的代码
- 代码的版权声明怎么写
- mySql 的分页代码怎么写
- 行转列的变种
- 套接字编程(VC_Win32)
- shell脚本抽取文本文件中指定字符串的方法:sed+grep方法、awk+grep方法(必要时可以联合sed以及grep)、grep+cut方法
- C++必知必会之(7)常量指针与指向常量的指针
- 每天一个linux命令:cd(change directory)
- 怎么写平台相关代码整理
- Android系统Recovery工作原理之使用update.zip升级过程分析(一)---update.zip包的制作
- Spring+Hibernate多线程访问数据库
- ie6框架下,出现横向滚动条bug
- android studio无法更新解决方案【附终极解决方法】
- hdu4781Assignment For Princess(2013 成都)构造题
- “黑马程序员”布局管理器
- Struts2配置详解_配置Action
- H.460.18