Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[MSVC] cleaner solution to the lack of unistd for flex parsers
[simgrid.git] / src / xbt / automaton / parserPromela.lex
index 7b64a62..b93895b 100644 (file)
@@ -1,7 +1,24 @@
+/* Copyright (c) 2012, 2014. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 %option noyywrap
 
 %{
 
+#include "simgrid_config.h"
+#ifndef HAVE_UNISTD_H
+#define YY_NO_UNISTD_H /* hello Windows */
+
+#ifdef _MSC_VER
+# include <io.h>
+# include <process.h>
+# define _CRT_SECURE_NO_WARNINGS
+# define _CRT_NONSTDC_NO_WARNINGS
+#endif
+#endif
 
 #include <stdio.h>
 #include "parserPromela.tab.hacc"