LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 634|回复: 2

关于TC的问题

[复制链接]
发表于 2003-5-12 17:29:08 | 显示全部楼层 |阅读模式
/*  time.h

    Struct and function declarations for dealing with time.

    Copyright (c) Borland International 1987,1988
    All Rights Reserved.
*/
#if __STDC__
#define _Cdecl
#else
#define _Cdecl  cdecl
#endif

#ifndef _TM_DEFINED
#define _TM_DEFINED

#ifndef  __TIME_T


#define  __TIME_T
typedef    long  time_t;
#endif

#ifndef  __CLOCK_T
#define  __CLOCK_T
typedef long clock_t;
#define CLK_TCK  18.2
#endif

struct  tm  {
    int tm_sec;
    int tm_min;
    int tm_hour;
    int tm_mday;
    int tm_mon;
    int tm_year;
    int tm_wday;
    int tm_yday;
    int tm_isdst;
};



char    *_Cdecl asctime (const struct tm *tblock);
char    *_Cdecl ctime   (const time_t *time);
double   _Cdecl difftime(time_t time2, time_t time1);
struct tm *_Cdecl gmtime(const time_t *timer);
struct tm *_Cdecl localtime(const time_t *timer);
time_t   _Cdecl time    (time_t *timer);
clock_t      _Cdecl    clock(void);

#if !__STDC__
extern int  _Cdecl daylight;
extern long _Cdecl timezone;

int _Cdecl stime(time_t *tp);
void    _Cdecl tzset(void);
#endif

#endif
这个是TC的include文件夹里的time.c文件,
而且每个好像都有?
请问在函数说明前面的那个_Cdecl 有什么用啊?
发表于 2003-5-13 02:31:08 | 显示全部楼层
你的 TC 的意思是 Turbo C 吧?不会是 Tom Cruise 吧?嘻嘻

我记得 Turbo C 和 MS 的编译器可以指定一个函数使用 C 的参数传递规则还是 pascal 的规则。即得有一个 pascal 的关键字吧?
好多 Windows API 函数声明为 long far pascal ... ()

我看 _Cdecl (其实就是 cdecl )是声明这个函数是遵照 C 的规则的。
 楼主| 发表于 2003-5-13 07:19:42 | 显示全部楼层
应该是的,
我昨天也问了其他人,
他们也是这么说的
谢谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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