aboutsummaryrefslogtreecommitdiff
path: root/.patch/glslang/0001-haikuos-fix.patch
blob: ba68bc97299bcfff805e75e2ce386c95843b731a (plain) (blame)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index be7f442..5fd0438 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -1766,9 +1766,10 @@ int singleMain()
         glslang::FinalizeProcess();
     } else {
         ShInitialize();
+#ifndef __HAIKU__
         ShInitialize();  // also test reference counting of users
         ShFinalize();    // also test reference counting of users
-
+#endif
         bool printShaderNames = workList.size() > 1;
 
         if (Options & EOptionMultiThreaded) {
@@ -1793,8 +1794,9 @@ int singleMain()
                 PutsIfNonEmpty(WorkItems[w]->results.c_str());
             }
         }
-
+#ifndef __HAIKU__
         ShFinalize();
+#endif
     }
 
     if (CompileFailed.load())
@@ -1809,8 +1811,10 @@ int C_DECL main(int argc, char* argv[])
 {
     ProcessArguments(WorkItems, argc, argv);
 
+#ifdef __HAIKU__
+    return singleMain();
+#else
     int ret = 0;
-
     // Loop over the entire init/finalize cycle to watch memory changes
     const int iterations = 1;
     if (iterations > 1)
@@ -1820,8 +1824,8 @@ int C_DECL main(int argc, char* argv[])
         if (iterations > 1)
             glslang::OS_DumpMemoryCounters();
     }
-
     return ret;
+#endif
 }
 
 //