Fix type issues with int32 and timespec

* Change in to int32 for consitency
* Use the standard "timespec" struct for VS2015 and above
diff --git a/source/dng_image.cpp b/source/dng_image.cpp
index ae99b9e..2026b9a 100644
--- a/source/dng_image.cpp
+++ b/source/dng_image.cpp
@@ -553,8 +553,8 @@
 					 edgeOption,
 					 dng_rect (fBounds.t,
 					 		   fBounds.l,
-					 		   fBounds.t + (int)repeatV,
-					 		   fBounds.l + (int)repeatH),
+					 		   fBounds.t + (int32)repeatV,
+					 		   fBounds.l + (int32)repeatH),
 					 areaTL);
 			
 			}
@@ -570,7 +570,7 @@
 					 edgeOption,
 					 dng_rect (fBounds.t,
 					 		   areaTM.l,
-					 		   fBounds.t + (int)repeatV,
+					 		   fBounds.t + (int32)repeatV,
 					 		   areaTM.r),
 					 areaTM);
 			
@@ -586,8 +586,8 @@
 			GetEdge (buffer,
 					 edgeOption,
 					 dng_rect (fBounds.t,
-					 		   fBounds.r - (int)repeatH,
-					 		   fBounds.t + (int)repeatV,
+					 		   fBounds.r - (int32)repeatH,
+					 		   fBounds.t + (int32)repeatV,
 					 		   fBounds.r),
 					 areaTR);
 			
@@ -605,7 +605,7 @@
 					 dng_rect (areaLM.t,
 					 		   fBounds.l,
 					 		   areaLM.b,
-					 		   fBounds.l + (int)repeatH),
+					 		   fBounds.l + (int32)repeatH),
 					 areaLM);
 			
 			}
@@ -620,7 +620,7 @@
 			GetEdge (buffer,
 					 edgeOption,
 					 dng_rect (areaRM.t,
-					 		   fBounds.r - (int)repeatH,
+					 		   fBounds.r - (int32)repeatH,
 					 		   areaRM.b,
 					 		   fBounds.r),
 					 areaRM);
@@ -636,10 +636,10 @@
 			
 			GetEdge (buffer,
 					 edgeOption,
-					 dng_rect (fBounds.b - (int)repeatV,
+					 dng_rect (fBounds.b - (int32)repeatV,
 					 		   fBounds.l,
 					 		   fBounds.b,
-					 		   fBounds.l + (int)repeatH),
+					 		   fBounds.l + (int32)repeatH),
 					 areaBL);
 			
 			}
@@ -653,7 +653,7 @@
 			
 			GetEdge (buffer,
 					 edgeOption,
-					 dng_rect (fBounds.b - (int)repeatV,
+					 dng_rect (fBounds.b - (int32)repeatV,
 					 		   areaBM.l,
 					 		   fBounds.b,
 					 		   areaBM.r),
@@ -670,8 +670,8 @@
 			
 			GetEdge (buffer,
 					 edgeOption,
-					 dng_rect (fBounds.b - (int)repeatV,
-					 		   fBounds.r - (int)repeatH,
+					 dng_rect (fBounds.b - (int32)repeatV,
+					 		   fBounds.r - (int32)repeatH,
 					 		   fBounds.b,
 					 		   fBounds.r),
 					 areaBR);
diff --git a/source/dng_pthread.h b/source/dng_pthread.h
index 0a28a1b..2095321 100644
--- a/source/dng_pthread.h
+++ b/source/dng_pthread.h
@@ -53,6 +53,14 @@
 
 #endif
 
+// Use the standard "timespec" struct for VS2015 and above from <time.h>. Define
+// "dng_timespec" as "timespec" otherwise.
+#if _MSC_VER >= 1900
+#include <time.h>
+#else
+#define timespec dng_timespec
+#endif
+
 #ifdef __cplusplus
 extern "C"
 {
@@ -67,7 +75,6 @@
 	long tv_nsec;
 };
 
-
 typedef unsigned long dng_pthread_t;
 
 typedef struct dng_pthread_mutex_impl *dng_pthread_mutex_t;
@@ -179,8 +186,6 @@
 #undef PTHREAD_ONCE_INIT
 #define PTHREAD_ONCE_INIT DNG_PTHREAD_ONCE_INIT
 
-#define timespec dng_timespec
-
 /* If it is defined on Windows, it probably has the wrong value... */
 #if defined(WIN32) || !defined(ETIMEDOUT)
 #undef ETIMEDOUT