#ifdef _WIN32
# include <windows.h>
+#elif defined(__APPLE__)
+# include <mach-o/dyld.h>
+#else
+# include <sys/types.h>
+# include <sys/stat.h>
#endif
#include <unistd.h>
log_assert(suffixlen == 0);
char *p = strdup(template_str.c_str());
- mkdtemp(p, suffixlen);
+ mkdtemp(p);
template_str = p;
free(p);
log_assert(n >= 0);
for (int i = 0; i < n; i++) {
if (strcmp(namelist[i]->d_name, ".") && strcmp(namelist[i]->d_name, "..")) {
- buffer = stringf("%s/%s", dirname.c_str(), namelist[i]->d_name);
+ std::string buffer = stringf("%s/%s", dirname.c_str(), namelist[i]->d_name);
if (!stat(buffer.c_str(), &stbuf) && S_ISREG(stbuf.st_mode)) {
log("Removing `%s'.\n", buffer.c_str());
remove(buffer.c_str());
return std::string(path, buflen);
}
#elif defined(__APPLE__)
-#include <mach-o/dyld.h>
std::string proc_self_dirname()
{
char *path = NULL;
#include <string.h>
#include <stdio.h>
+#ifdef YOSYS_ENABLE_TCL
+# include <tcl.h>
+#endif
+
#define PRIVATE_NAMESPACE_BEGIN namespace {
#define PRIVATE_NAMESPACE_END }
#define YOSYS_NAMESPACE_BEGIN namespace Yosys {
void yosys_shutdown();
#ifdef YOSYS_ENABLE_TCL
-#include <tcl.h>
Tcl_Interp *yosys_get_tcl_interp();
#endif