[질문] 다음과 같은 함수 선언문의 의미는?

omando의 이미지

C++로 작성된 코드를 분석중에 다음과 같은 이해할수 없는 함수들이
여러 군데에 선언되어 있던데요.

LPCTSTR __fastcall SkipComments(LPCTSTR Str);
..
bool  __fastcall GetValueFrom(CMyType Type, char *Src);
..
QueueElm * __fastcall CCommonQueue::GetWithoutLock(void);
등등의 함수에서
Retrurn type과 함수명 사이에 _fastcall 이라는게 들어가 있는데
왜 삽입된건지
문법적으로 문제는 없는건지. 의도가 무언지 모르겠어요.
이런 형식의 함수는 첨보는거라 어렵군요.

글구 별도로 Type.h라는 파일에 _fastcall이 정의되어있습니다
....
...

#define	__fastcall

typedef	unsigned char    UCHAR;
typedef	unsigned short   USHORT;
typedef	unsigned int       UINT;

typedef short int	          SHORT;

#ifdef __USE_4BYTES_LONG
typedef int  	          LONG;
typedef	unsigned int       ULONG;
#else
typedef long	          LONG;
typedef	unsigned long    ULONG;
#endif

typedef	UCHAR	BYTE;
typedef	USHORT	WORD;
typedef	UINT	DWORD;

typedef	bool	boolean;
typedef	bool	BOOLEAN;
typedef	bool	BOOL;
typedef void *		LPVOID;

typedef const char *              LPCTSTR;
typedef LPCTSTR		LPCSTR;
typedef char *		LPTSTR;
...
...
익명 사용자의 이미지

__fastcall은 함수에 인수를 전달할 때 __stdcall처럼 스택에다 쌓지 말고 레지스터를 통해 직접 넘겨주라는 뜻입니다. __fastcall 타입의 함수는 컴파일하고 나면 심볼명 앞에 @가 붙게 됩니다.

charsyam의 이미지

함수 호출 방식이 있습니다. cdecl, fastcall, stdcall, pascal 등 말입니다.

fastcall의 경우 파라매터 두 개만 레지스터에 집어넣고 나머지는 스택에 넣습니

다. 그러니깐 두 개만 파라매터를 쓰면 훨씬 빠르겠죠

나머지는 한번 찾아보세요.

=========================
CharSyam ^^ --- 고운 하루
=========================