summaryrefslogtreecommitdiffstats
path: root/src/skel/crossplatform.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/skel/crossplatform.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h
index e5f4c7ba..710a7702 100644
--- a/src/skel/crossplatform.h
+++ b/src/skel/crossplatform.h
@@ -132,7 +132,12 @@ void GetLocalTime_CP(SYSTEMTIME* out);
typedef void* HANDLE;
#define INVALID_HANDLE_VALUE NULL
-#define FindClose(h) closedir((DIR*)h)
+#define FindClose(h) \
+ do { \
+ if (h != nil) \
+ closedir((DIR*)h); \
+ } while(0)
+
#define LOCALE_USER_DEFAULT 0
#define DATE_SHORTDATE 0