免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1460 | 回复: 6
打印 上一主题 下一主题

关于#if的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-03 01:48 |只看该作者 |倒序浏览
  1. #define        MT_NOTMBUF        0        /* USED INTERNALLY ONLY! Object is not mbuf */
复制代码

是不是说从#if   0 到 #endif 的所有宏定义都不可能执行?

论坛徽章:
0
2 [报告]
发表于 2007-07-03 01:50 |只看该作者
#define        MT_NOTMBUF        0        /* USED INTERNALLY ONLY! Object is not mbuf */
#define        MT_DATA                1        /* dynamic (data) allocation */
#define        MT_HEADER        2        /* packet header */
#if 0
#define        MT_SOCKET        3        /* socket structure */
#define        MT_PCB                4        /* protocol control block */
#define        MT_RTABLE        5        /* routing tables */
#define        MT_HTABLE        6        /* IMP host tables */
#define        MT_ATABLE        7        /* address resolution tables */
#endif
#define        MT_SONAME        8        /* socket name */
#if 0
#define        MT_SOOPTS        10        /* socket options */
#endif
#define        MT_FTABLE        11        /* fragment reassembly header */
#if 0
#define        MT_RIGHTS        12        /* access rights */
#define        MT_IFADDR        13        /* interface address */
#endif
#define        MT_CONTROL        14        /* extra-data protocol message */
#define        MT_OOBDATA        15        /* expedited data  */
#define        MT_NTYPES        16        /* number of mbuf types for mbtypes[] */

#define        MT_NOINIT        255        /* Not a type but a flag to allocate
                                   a non-initialized mbuf */

论坛徽章:
0
3 [报告]
发表于 2007-07-03 03:00 |只看该作者
AFAICT, there is no evident relationship between your question and your code.

论坛徽章:
0
4 [报告]
发表于 2007-07-03 10:13 |只看该作者
  1. #if 0
  2. #define        MT_RIGHTS        12        /* access rights */
  3. #define        MT_IFADDR        13        /* interface address */
  4. #endif
复制代码

  1. #if 0
  2. 没错,里面的代码不会运行的,和注释了差不多。
  3. #endif
复制代码

论坛徽章:
0
5 [报告]
发表于 2007-07-03 14:46 |只看该作者
那他为什么这样写?是为了以后扩展吗?

论坛徽章:
0
6 [报告]
发表于 2007-07-03 16:14 |只看该作者
为了调试程序!

论坛徽章:
0
7 [报告]
发表于 2007-07-03 17:14 |只看该作者
恩。谢谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP