Add wrapper for getting X509_digest from a cert
[folly.git] / folly / portability / Windows.h
old mode 100755 (executable)
new mode 100644 (file)
index 3b48858..4186058
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #ifndef __STDC__
 /* nolint */
 #define __STDC__ 1
-#include <io.h> // nolint
-#include <direct.h> // nolint
+#include <direct.h> // @manual nolint
+#include <io.h> // @manual nolint
 #undef __STDC__
 #else
-#include <io.h> // nolint
-#include <direct.h> // nolint
+#include <direct.h> // @manual nolint
+#include <io.h> // @manual nolint
 #endif
 
-#include <Windows.h>
-#include <WinSock2.h>
+#if defined(min) || defined(max)
+#error Windows.h needs to be included by this header, or else NOMINMAX needs \
+ to be defined before including it yourself.
+#endif
 
-#ifdef CAL_GREGORIAN
-#undef CAL_GREGORIAN
+// This is needed because, for some absurd reason, one of the windows headers
+// tries to define "min" and "max" as macros, which messes up most uses of
+// std::numeric_limits.
+#ifndef NOMINMAX
+#define NOMINMAX 1
 #endif
 
-// Defined in winnt.h
-#ifdef DELETE
-#undef DELETE
+#include <WinSock2.h> // @manual
+#include <Windows.h> // @manual
+
+#ifdef CAL_GREGORIAN
+#undef CAL_GREGORIAN
 #endif
 
 // Defined in the GDI interface.