易码技术论坛

 找回密码
 加入易码
搜索
查看: 168339|回复: 2

条件编译代码怎么写?

[复制链接]
发表于 2006-11-17 17:51:22 | 显示全部楼层
#if COLOR==256

#define WINDOWSBKCOLOR 83
#define GAMEBKCOLOR 6
#define BLACK 0
#define WHITE 1
#define BLUE 68

#else

#define WINDOWSBKCOLOR 3
#define GAMEBKCOLOR 5
#define BLACK 15
#define WHITE 0
#define BLUE 10

#endif
 楼主| 发表于 2006-11-17 18:04:33 | 显示全部楼层
谢谢LEE!
 楼主| 发表于 2006-11-17 17:43:19 | 显示全部楼层 |阅读模式
  比如说:
如果我先定义的是:

#define COLOR 256

那么就定义下面的宏定义

#define WINDOWSBKCOLOR 83
#define GAMEBKCOLOR 6
#define BLACK 0
#define WHITE 1
#define BLUE 68

否则定义如下宏定义:

#define WINDOWSBKCOLOR 3
#define GAMEBKCOLOR 5
#define BLACK 15
#define WHITE 0
#define BLUE 10

那么这里要怎么写呢?
您需要登录后才可以回帖 登录 | 加入易码

本版积分规则

Archiver|手机版|小黑屋|EMAX Studio

GMT+8, 2024-4-28 00:45 , Processed in 0.009784 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表