Pārlūkot izejas kodu

dtoolutil: disable pfstream on emscripten, which has no popen

This prevents a popen symbol error when compiling for Emscripten.
rdb 7 gadi atpakaļ
vecāks
revīzija
697e8838c4

+ 4 - 0
dtool/src/dtoolutil/pfstream.h

@@ -16,6 +16,8 @@
 
 
 #include "pfstreamBuf.h"
 #include "pfstreamBuf.h"
 
 
+#ifndef __EMSCRIPTEN__
+
 class EXPCL_DTOOL_DTOOLUTIL IPipeStream : public std::istream {
 class EXPCL_DTOOL_DTOOLUTIL IPipeStream : public std::istream {
 public:
 public:
   INLINE IPipeStream(const std::string);
   INLINE IPipeStream(const std::string);
@@ -50,4 +52,6 @@ private:
 
 
 #include "pfstream.I"
 #include "pfstream.I"
 
 
+#endif /* __EMSCRIPTEN__ */
+
 #endif /* __PFSTREAM_H__ */
 #endif /* __PFSTREAM_H__ */

+ 4 - 0
dtool/src/dtoolutil/pfstreamBuf.cxx

@@ -14,6 +14,8 @@
 #include "pfstreamBuf.h"
 #include "pfstreamBuf.h"
 #include <assert.h>
 #include <assert.h>
 
 
+#ifndef __EMSCRIPTEN__
+
 using std::cerr;
 using std::cerr;
 using std::endl;
 using std::endl;
 using std::string;
 using std::string;
@@ -405,3 +407,5 @@ read_pipe(char *data, size_t len) {
 
 
 
 
 #endif  // WIN_PIPE_CALLS
 #endif  // WIN_PIPE_CALLS
+
+#endif  // __EMSCRIPTEN__

+ 5 - 0
dtool/src/dtoolutil/pfstreamBuf.h

@@ -18,6 +18,9 @@
 #include <string>
 #include <string>
 #include <stdio.h>
 #include <stdio.h>
 
 
+// Emscripten does not have popen.
+#ifndef __EMSCRIPTEN__
+
 // By default, we'll use the Windows flavor of pipe functions if we're
 // By default, we'll use the Windows flavor of pipe functions if we're
 // compiling under Windows.  Turn this off to use popen(), even on Windows.
 // compiling under Windows.  Turn this off to use popen(), even on Windows.
 // (popen() doesn't seem to work on Win9x, although it does work on NT-based
 // (popen() doesn't seem to work on Win9x, although it does work on NT-based
@@ -77,4 +80,6 @@ private:
   void write_chars(const char*, int, bool);
   void write_chars(const char*, int, bool);
 };
 };
 
 
+#endif /* __EMSCRIPTEN__ */
+
 #endif /* __PFSTREAMBUF_H__ */
 #endif /* __PFSTREAMBUF_H__ */

+ 6 - 0
dtool/src/prc/configPageManager.cxx

@@ -406,6 +406,11 @@ reload_implicit_pages() {
 
 
     if ((file._file_flags & FF_execute) != 0 &&
     if ((file._file_flags & FF_execute) != 0 &&
         filename.is_executable()) {
         filename.is_executable()) {
+
+#ifdef __EMSCRIPTEN__
+      prc_cat.error()
+        << "Executable config files are not supported with Emscripten.\n";
+#else
       // Attempt to execute the file as a command.
       // Attempt to execute the file as a command.
       string command = filename.to_os_specific();
       string command = filename.to_os_specific();
 
 
@@ -428,6 +433,7 @@ reload_implicit_pages() {
       _pages_sorted = false;
       _pages_sorted = false;
 
 
       page->read_prc(ifs);
       page->read_prc(ifs);
+#endif  // __EMSCRIPTEN__
 
 
     } else if ((file._file_flags & FF_decrypt) != 0) {
     } else if ((file._file_flags & FF_decrypt) != 0) {
       // Read and decrypt the file.
       // Read and decrypt the file.