NaCl runtime fixes
[mono.git] / mono / monograph / monograph.c
index 5451b8b54f33146c699460c7f89329d88f65fa5f..27f1a5f3cf9cf801d857e750382395fcb80cccff 100644 (file)
@@ -1,6 +1,7 @@
 #include <glib.h>
 #include <string.h>
 #include <math.h>
+#include "mono/metadata/metadata-internals.h"
 #include "mono/metadata/class-internals.h"
 #include "mono/metadata/assembly.h"
 #include "mono/metadata/tokentype.h"
@@ -17,6 +18,11 @@ static int max_depth = 6;
 static int verbose = 0;
 static const char *graph_properties = "\tnode [fontsize=8.0]\n\tedge [len=2,color=red]\n";
 
+#if defined(__native_client__) || defined(__native_client_codegen__)
+volatile int __nacl_thread_suspension_needed = 0;
+void __nacl_suspend_thread_if_needed() {}
+#endif
+
 static void
 output_type_edge (MonoClass *first, MonoClass *second) {
        if (include_namespace)
@@ -550,9 +556,9 @@ get_signature (MonoMethod *method) {
 
        res = g_string_new ("");
        if (include_namespace && *(method->klass->name_space))
-               g_string_sprintfa (res, "%s.", method->klass->name_space);
+               g_string_append_printf (res, "%s.", method->klass->name_space);
        result = mono_signature_get_desc (mono_method_signature (method), include_namespace);
-       g_string_sprintfa (res, "%s:%s(%s)", method->klass->name, method->name, result);
+       g_string_append_printf (res, "%s:%s(%s)", method->klass->name, method->name, result);
        g_free (result);
        g_hash_table_insert (hash, method, res->str);
 
@@ -1147,10 +1153,10 @@ main (int argc, char *argv[]) {
 
                if (outputfile) {
                        type = strrchr (outputfile, '.');
-                       g_string_sprintfa (command, " -o %s", outputfile);
+                       g_string_append_printf (command, " -o %s", outputfile);
                }
                if (type)
-                       g_string_sprintfa (command, " -T%s", type + 1);
+                       g_string_append_printf (command, " -T%s", type + 1);
                output = popen (command->str, "w");
                if (!output) {
                        g_print ("Cannot run neato: you may need to install the graphviz package.\n");
@@ -1199,5 +1205,3 @@ main (int argc, char *argv[]) {
                fclose (output);
        return 0;
 }
-
-