#include <stdio.h> # define FAST_FUNC /* nothing */ FILE* FAST_FUNC fopen_for_read(const char *path) { return fopen(path, "r"); } FILE* FAST_FUNC xfopen(const char *path, const char *mode) { FILE *fp = fopen(path, mode); if (fp == NULL) printf("can't open '%s'", path); return fp; } FILE* FAST_FUNC xfopen_for_read(const char *path) { return xfopen(path, "r"); } FILE* FAST_FUNC fopen_for_write(const char *path) { return fopen(path, "w"); } FILE* FAST_FUNC xfopen_for_write(const char *path) { return xfopen(path, "w"); } int main() { printf("hello,world"); return 0; }
标签:xfopen,const,read,char,FILE,path,fopen From: https://www.cnblogs.com/hshy/p/18166392