Header changes so it will compile on VS

This commit is contained in:
William Speirs 2014-10-16 12:06:54 -04:00 committed by Clifford Wolf
parent fda52f05f2
commit 31267a1ae8
10 changed files with 79 additions and 17 deletions

View File

@ -20,11 +20,14 @@
#include "kernel/yosys.h"
#include "kernel/sigtools.h"
#include "kernel/log.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#ifndef _WIN32
# include <unistd.h>
# include <dirent.h>
#endif
USING_YOSYS_NAMESPACE

View File

@ -20,14 +20,17 @@
#include "kernel/register.h"
#include "kernel/sigtools.h"
#include "kernel/log.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#ifndef _WIN32
# include <unistd.h>
# include <dirent.h>
#endif
YOSYS_NAMESPACE_BEGIN
struct Vhdl2verilogPass : public Pass {

View File

@ -27,11 +27,14 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <libgen.h>
#include <limits.h>
#include <errno.h>
#ifndef _WIN32
# include <unistd.h>
#endif
USING_YOSYS_NAMESPACE
int main(int argc, char **argv)

View File

@ -33,17 +33,21 @@
#elif defined(__APPLE__)
# include <mach-o/dyld.h>
#else
# include <unistd.h>
# include <dirent.h>
# include <sys/types.h>
# include <sys/stat.h>
#endif
#include <unistd.h>
#include <limits.h>
#include <dirent.h>
#include <errno.h>
YOSYS_NAMESPACE_BEGIN
#ifdef _WIN32
const char *yosys_version_str = "Windows";
#endif
int autoidx = 1;
RTLIL::Design *yosys_design = NULL;
@ -325,10 +329,10 @@ void yosys_shutdown()
#ifdef YOSYS_ENABLE_PLUGINS
for (auto &it : loaded_plugins)
dlclose(it.second);
#endif
loaded_plugins.clear();
loaded_plugin_aliases.clear();
#endif
}
RTLIL::IdString new_id(std::string file, int line, std::string func)

View File

@ -68,6 +68,30 @@
# include <tcl.h>
#endif
// a few platform specific things
#ifdef _WIN32
# define NOMINMAX
# include <Windows.h>
# include <stdint.h> // takes care of a number of typedefs
# include <io.h>
# include <direct.h>
// these are always a bit dangerous :-)
# define strtok_r strtok_s
# define strdup _strdup
# define snprintf _snprintf
# define access _access
# define getcwd _getcwd
# define mkdir _mkdir
# define popen _popen
# define pclose _pclose
# define PATH_MAX MAX_PATH
# define F_OK 00
# define X_OK 00 // note this is NOT correct as there is no execute flag in Windows
#endif
#define PRIVATE_NAMESPACE_BEGIN namespace {
#define PRIVATE_NAMESPACE_END }
#define YOSYS_NAMESPACE_BEGIN namespace Yosys {
@ -85,6 +109,9 @@
#if !defined(__GNUC__) && !defined(__clang__)
# define __attribute__(...)
# define _NORETURN_ __declspec(noreturn)
#else
# define _NORETURN_
#endif
YOSYS_NAMESPACE_BEGIN
@ -96,7 +123,7 @@ namespace RTLIL {
struct Cell;
}
std::string stringf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
std::string stringf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
std::string vstringf(const char *fmt, va_list ap);
std::string next_token(std::string &text, const char *sep);
bool patmatch(const char *pattern, const char *string);

View File

@ -27,7 +27,10 @@
#include <stdint.h>
#include <csignal>
#include <cinttypes>
#include <unistd.h>
#ifndef _WIN32
# include <unistd.h>
#endif
#include "../minisat/Solver.h"
#include "../minisat/SimpSolver.h"

View File

@ -43,15 +43,18 @@
#include "kernel/sigtools.h"
#include "kernel/cost.h"
#include "kernel/log.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <cerrno>
#include <sstream>
#include <climits>
#ifndef _WIN32
# include <unistd.h>
# include <dirent.h>
#endif
#include "blifparse.h"
USING_YOSYS_NAMESPACE

View File

@ -17,9 +17,18 @@
*
*/
#include <sys/types.h>
#include <unistd.h>
#include "kernel/yosys.h"
#include <sys/types.h>
#ifndef _WIN32
# include <unistd.h>
#else
# include <io.h>
#endif
#include "kernel/register.h"
#include "kernel/rtlil.h"
#include "kernel/log.h"
USING_YOSYS_NAMESPACE
PRIVATE_NAMESPACE_BEGIN

View File

@ -21,7 +21,10 @@
#include "kernel/celltypes.h"
#include "kernel/log.h"
#include <string.h>
#include <dirent.h>
#ifndef _WIN32
# include <dirent.h>
#endif
#ifdef YOSYS_ENABLE_READLINE
# include <readline/readline.h>

View File

@ -21,7 +21,11 @@
#include <stdlib.h>
#include <stdio.h>
#include <set>
#include <unistd.h>
#ifndef _WIN32
# include <unistd.h>
#endif
USING_YOSYS_NAMESPACE
PRIVATE_NAMESPACE_BEGIN