我对 cdecl 调用约定有疑问:
void Test1(char* str, ...) // ok
{}
void cdecl Test2(char* str, ...) // error: expected initializer before 'Test2'
{}
int main()
{}
我应该怎么做才能让编译器识别 cdecl 调用约定?
谢谢!
平台:Windows 7;明威;GCC 4.6.1
我无法修改这些函数,因为它们是文件 FRAMEWRK.H 中“Microsoft Excel 开发工具包,版本 14”的一部分:
///***************************************************************************
// File: FRAMEWRK.H
//
// Purpose: Header file for Framework library
//
// Platform: Microsoft Windows
//...
// From the Microsoft Excel Developer's Kit, Version 14
// Copyright (c) 1997 - 2010 Microsoft Corporation. All rights reserved.
///***************************************************************************
...
//
// Function prototypes
//
#ifdef __cplusplus
extern "C" {
#endif
void far cdecl debugPrintf(LPSTR lpFormat, ...);
LPSTR GetTempMemory(size_t cBytes);
void FreeAllTempMemory(void);
...