summaryrefslogtreecommitdiffstats
path: root/main/zsnes/zsnes-1.51-depbuild.patch
blob: e2cc0d86f64c806923d4c017c11c1470687dd6f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/src/tools/depbuild.cpp	Fri Nov 13 18:41:24 2009
+++ b/src/tools/depbuild.cpp	Fri Nov 13 19:04:09 2009
@@ -24,6 +24,9 @@
 #include <iostream>
 #include <string>
 #include <cstdio>
+#include <cstdlib>
+#include <unistd.h>
+
 using namespace std;
 
 #include "fileutil.h"
@@ -130,7 +133,20 @@
 void dependency_calculate_asm(const char *filename)
 {
   string command = nasm + " " + nflags + " -M " + filename;
-  system(command.c_str());
+  FILE *fp = popen(command.c_str(), "r");
+  if (fp)
+  {
+    char line[256];
+    while (fgets(line, sizeof(line), fp)) //Process all lines of output
+    {
+      cout << line;
+    }
+    pclose(fp);
+  }
+  else
+  {
+    cerr << "Failed on: " << filename << "\n";
+  }
 }
 
 void dependency_calculate_psr(const char *filename)