static void MD5Transform PROTO_LIST((UINT4 [4], unsigned char [64]));
编译时错误:
: error C2146: syntax error : missing ';' before identifier 'PROTO_LIST'
: error C2182: 'MD5Transform' : illegal use of type 'void'
: fatal error C1004: unexpected end of file found
相关的代码:
static void MD5Transform (state, block)
UINT4 state[4];
unsigned char block[64];
{
#ifndef PROTOTYPES
#define PROTOTYPES 0
#endif
#if PROTOTYPES
#define PROTO_LIST(list) list
#else
#define PROTO_LIST(list) ()
#endif哪位高手能帮我解释解释吗?
编译时错误:
: error C2146: syntax error : missing ';' before identifier 'PROTO_LIST'
: error C2182: 'MD5Transform' : illegal use of type 'void'
: fatal error C1004: unexpected end of file found
相关的代码:
static void MD5Transform (state, block)
UINT4 state[4];
unsigned char block[64];
{
#ifndef PROTOTYPES
#define PROTOTYPES 0
#endif
#if PROTOTYPES
#define PROTO_LIST(list) list
#else
#define PROTO_LIST(list) ()
#endif哪位高手能帮我解释解释吗?
解决方案 »
- 一个小问题调试一天了,求助各路神仙?
- 呵呵,一个引用计数的小问题,请达人明示
- BoundsCheckerv8.2版本使用出错:'WatchListErrorCoed = ErrorDoesNotExist'
- CSocket 通信问题
- 初学者碰到的问题???
- ★★★关于面试★★★ 公司是做通信软件的,用c/c++,不知道会考试什么内容?
- 高分!!我想在一个对话框里显示HTML页面
- 谁告诉我如何给列表框加列
- 谁有1990-1995年的高程试卷,能发给我吗?
- 用CHtmlView视图创建的单文档网络浏览器,怎么实现输入地址
- 我要根据条件循环动态创建多个控件,怎样才能实现啊?高手们,快来帮忙!
- 高手帮忙!!!!!!在线等!!!
#ifndef PROTOTYPES
#define PROTOTYPES 0
#endif
#if PROTOTYPES
#define PROTO_LIST(list) list
#else
#define PROTO_LIST(list) ()
#endif被包含于static void MD5Transform PROTO_LIST((UINT4 [4], unsigned char [64]));
这个声明之前,另外,预定义这个常量PROTOTYPES
static void MD5Transform PROTO_LIST(UINT4 [4], unsigned char [64]);
如果没有定义过,应改写成:static void MD5Transform (UINT4 [4], unsigned char [64]);
上面说的都已经做到了,还是老样子:(
to:nelsonc() ,取消宏后,错误更多
static void MD5Transform (state, block)
UINT4 state[4];
unsigned char block[64];
{你先把文件的扩展名改为 *.h, *.c 看看,因为VC是通过扩展名来处理编译方式的。如果不行的话,只能都改为C++的定义方式了:typedef int UINT4; //这是我加的,如果你的代码里定义了UINT4,就不必了#ifndef PROTOTYPES
#define PROTOTYPES 0
#endif#if PROTOTYPES
#define PROTO_LIST(list) list
#else
#define PROTO_LIST(list) ()
#endifstatic void MD5Transform PROTO_LIST((UINT4 [4], unsigned char [64])); static void MD5Transform (UINT4 state[4], unsigned char block[64])
{
}以上代码我测试过,可以通过编译。
static void MD5Transform (UINT4 [4], unsigned char [64]);
//把PROTO_LIST(...)直接替换为括号内内容
如果PROTOTYPES没有定义,就扩展成:
static void MD5Transform (); //把PROTO_LIST(...)替换为()
这确实是从c代码里拷贝过来的,其他我都改过了,就是这一块,我也不知道怎么改
现在在VC++里运行
// PROTOTYPES == 1
static void MD5Transform(UINT4 state[4], unsigned char block[64])
{
...
}
#else
// PROTOTYPES == 0
static void MD5Transform
{
...
}
#endif // PROTOTYPES 我不知道具体的代码是如何的,似乎 define PROTOTYPES 1 用来表示某种特殊的情况,在这些情况下,函数MD5Transform必须采用特殊带参数的定义。