Remove redundant code in THGenerateAllTypes.h
diff --git a/THGenerateAllTypes.h b/THGenerateAllTypes.h
index 4a77081..778da9d 100644
--- a/THGenerateAllTypes.h
+++ b/THGenerateAllTypes.h
@@ -2,95 +2,10 @@
 #error "You must define TH_GENERIC_FILE before including THGenerateAllTypes.h"
 #endif
 
-#define real unsigned char
-#define accreal long
-#define Real Byte
-#define THInf UCHAR_MAX
-#define TH_REAL_IS_BYTE
-#line 1 TH_GENERIC_FILE
-#include TH_GENERIC_FILE
-#undef real
-#undef accreal
-#undef Real
-#undef THInf
-#undef TH_REAL_IS_BYTE
+#define THGenerateAllTypes
 
-#define real char
-#define accreal long
-#define Real Char
-#define THInf CHAR_MAX
-#define TH_REAL_IS_CHAR
-#line 1 TH_GENERIC_FILE
-#include TH_GENERIC_FILE
-#undef real
-#undef accreal
-#undef Real
-#undef THInf
-#undef TH_REAL_IS_CHAR
+#include "THGenerateFloatTypes.h"
+#include "THGenerateIntTypes.h"
 
-#define real short
-#define accreal long
-#define Real Short
-#define THInf SHRT_MAX
-#define TH_REAL_IS_SHORT
-#line 1 TH_GENERIC_FILE
-#include TH_GENERIC_FILE
-#undef real
-#undef accreal
-#undef Real
-#undef THInf
-#undef TH_REAL_IS_SHORT
-
-#define real int
-#define accreal long
-#define Real Int
-#define THInf INT_MAX
-#define TH_REAL_IS_INT
-#line 1 TH_GENERIC_FILE
-#include TH_GENERIC_FILE
-#undef real
-#undef accreal
-#undef Real
-#undef THInf
-#undef TH_REAL_IS_INT
-
-#define real long
-#define accreal long
-#define Real Long
-#define THInf LONG_MAX
-#define TH_REAL_IS_LONG
-#line 1 TH_GENERIC_FILE
-#include TH_GENERIC_FILE
-#undef real
-#undef accreal
-#undef Real
-#undef THInf
-#undef TH_REAL_IS_LONG
-
-#define real float
-#define accreal double
-#define Real Float
-#define THInf FLT_MAX
-#define TH_REAL_IS_FLOAT
-#line 1 TH_GENERIC_FILE
-#include TH_GENERIC_FILE
-#undef real
-#undef accreal
-#undef Real
-#undef THInf
-#undef TH_REAL_IS_FLOAT
-
-#define real double
-#define accreal double
-#define Real Double
-#define THInf DBL_MAX
-#define TH_REAL_IS_DOUBLE
-#line 1 TH_GENERIC_FILE
-#include TH_GENERIC_FILE
-#undef real
-#undef accreal
-#undef Real
-#undef THInf
-#undef TH_REAL_IS_DOUBLE
-
+#undef THGenerateAllTypes
 #undef TH_GENERIC_FILE
diff --git a/THGenerateFloatTypes.h b/THGenerateFloatTypes.h
index b6bdd07..00b791a 100644
--- a/THGenerateFloatTypes.h
+++ b/THGenerateFloatTypes.h
@@ -28,4 +28,6 @@
 #undef THInf
 #undef TH_REAL_IS_DOUBLE
 
+#ifndef THGenerateAllTypes
 #undef TH_GENERIC_FILE
+#endif
diff --git a/THGenerateHalfType.h b/THGenerateHalfType.h
index 9acc534..cd0b6ee 100644
--- a/THGenerateHalfType.h
+++ b/THGenerateHalfType.h
@@ -16,4 +16,6 @@
 #undef THInf
 #undef TH_REAL_IS_HALF
 
+#ifndef THGenerateAllTypes
 #undef TH_GENERIC_FILE
+#endif
diff --git a/THGenerateIntTypes.h b/THGenerateIntTypes.h
index a561d89..216a98d 100644
--- a/THGenerateIntTypes.h
+++ b/THGenerateIntTypes.h
@@ -67,4 +67,6 @@
 #undef THInf
 #undef TH_REAL_IS_LONG
 
+#ifndef THGenerateAllTypes
 #undef TH_GENERIC_FILE
+#endif