diff --git a/modules/dnn/src/torch/THGeneral.cpp b/modules/dnn/src/torch/THGeneral.cpp index dc56e3625..1bf0b4f89 100644 --- a/modules/dnn/src/torch/THGeneral.cpp +++ b/modules/dnn/src/torch/THGeneral.cpp @@ -1,14 +1,6 @@ #if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER -#include "THGeneral.h" #include -extern "C" -{ - -#ifndef TH_HAVE_THREAD -#define __thread -#endif - #if defined(TH_DISABLE_HEAP_TRACKING) #elif (defined(__unix) || defined(_WIN32)) #include @@ -16,6 +8,15 @@ extern "C" #include #endif +#include "THGeneral.h" + +extern "C" +{ + +#ifndef TH_HAVE_THREAD +#define __thread +#endif + /* Torch Error Handling */ static void defaultTorchErrorHandlerFunction(const char *msg, void*) {