MSVC compiler says that fopen() is deprecated, and recommends the use of fopen_s().
Is there any way to use fopen_s() and stil
In C/C++ code,
#ifdef __unix
#define fopen_s(pFile,filename,mode) ((*(pFile))=fopen((filename),(mode)))==NULL
#endif
In Makefile
CFLAGS += -D'fopen_s(pFile,filename,mode)=((*(pFile))=fopen((filename),(mode)))==NULL'
Attention that on success fopen_s return 0 while fopen return a nonzero file pointer. Therefore it is necessary to add "==NULL" to the end of macro, e.g.:
if (fopen_s(&pFile,filename,"r")) perror("cannot open file");