Linux でコードをコンパイルしようとしていて、単純な make ファイルを作成しました。私のヘッダーの 1 つに、Unix の dirent.h をエミュレートするファイルのコンパイル時の条件付き #include があります。
このインクルードを に入れましたが#if defined(_WIN32) || defined(_WIN64)
、g++ は喜んでファイルをインクルードするため、無限のエラーが発生します。
ブロック全体は次のようになります。
#if defined(_WIN32) || defined(_WIN64)
#include "dirent.h"
#define strncasecmp _strnicmp
#else
#include <unistd.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/types.h>
#include <utime.h>
#endif
これが起こる明らかな理由はありますか?