platform.c

来自「truecrypt-4.2a-source-cod 文件虚拟磁盘源代码」· C语言 代码 · 共 23 行

C
23
字号
#include <stdlib.h>
#include <stdio.h>

char *GetType (int size)
{
	if (size == sizeof (char)) return "char";
	if (size == sizeof (short)) return "short";
	if (size == sizeof (int)) return "int";
	if (size == sizeof (long)) return "long";
	if (size == sizeof (long long)) return "long long";

	fprintf (stderr, "Error: No type available for %d bytes\n", size);
	exit (1);
}

int main(int argc, char **argv)
{
	printf ("TYPES := -D__int8=\"%s\" -D__int16=\"%s\" -D__int32=\"%s\" -D__int64=\"%s\"\n",
		GetType (1), GetType (2), GetType (4), GetType (8));

	exit (0);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?