diff --git a/src/smb_ntlm.c b/src/smb_ntlm.c
index 998afd3..9f5e1da 100644
--- a/src/smb_ntlm.c
+++ b/src/smb_ntlm.c
@@ -28,14 +28,14 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
 #ifdef _WIN32
 # define _CRT_RAND_S
 #endif
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <assert.h>
 #include <ctype.h>
 #include <wctype.h>
