]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Drop POSIX profile ca020bf04a09fe16e5583eea5a3a341e7796bff5
authorJürg Billeter <j@bitron.ch>
Fri, 3 Aug 2012 07:52:14 +0000 (09:52 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 6 Aug 2012 11:24:05 +0000 (13:24 +0200)
32 files changed:
codegen/valaccodearraymodule.vala
codegen/valaccodeattribute.vala
codegen/valaccodebasemodule.vala
codegen/valaccodecompiler.vala
codegen/valaccodecontrolflowmodule.vala
codegen/valaccodemethodcallmodule.vala
codegen/valaccodemethodmodule.vala
codegen/valaccodestructmodule.vala
compiler/valacompiler.vala
vala/valaarraytype.vala
vala/valacatchclause.vala
vala/valacodecontext.vala
vala/valacreationmethod.vala
vala/valadatatype.vala
vala/valaelementaccess.vala
vala/valaflowanalyzer.vala
vala/valaforeachstatement.vala
vala/valagenieparser.vala
vala/valamemberaccess.vala
vala/valamethodcall.vala
vala/valaobjectcreationexpression.vala
vala/valaparser.vala
vala/valapointertype.vala
vala/valaprofile.vala
vala/valasemanticanalyzer.vala
vala/valathrowstatement.vala
vala/valatypecheck.vala
vala/valatypeofexpression.vala
vapi/libarchive.vapi
vapi/libdaemon.vapi
vapi/libxml-2.0.vapi
vapi/posix.vapi

index c99d474d52e55066594acebc067ece756da7f901..7bf68263da310bfcbd2f1f0234621a799f5a6de2 100644 (file)
@@ -56,14 +56,8 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                        return;
                }
 
-               CCodeFunctionCall gnew;
-               if (context.profile == Profile.POSIX) {
-                       cfile.add_include ("stdlib.h");
-                       gnew = new CCodeFunctionCall (new CCodeIdentifier ("calloc"));
-               } else {
-                       gnew = new CCodeFunctionCall (new CCodeIdentifier ("g_new0"));
-                       gnew.add_argument (new CCodeIdentifier (get_ccode_name (expr.element_type)));
-               }
+               var gnew = new CCodeFunctionCall (new CCodeIdentifier ("g_new0"));
+               gnew.add_argument (new CCodeIdentifier (get_ccode_name (expr.element_type)));
 
                bool first = true;
                CCodeExpression cexpr = null;
@@ -88,12 +82,6 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                
                gnew.add_argument (cexpr);
 
-               if (context.profile == Profile.POSIX) {
-                       var csizeof = new CCodeFunctionCall (new CCodeIdentifier ("sizeof"));
-                       csizeof.add_argument (new CCodeIdentifier (get_ccode_name (expr.element_type)));
-                       gnew.add_argument (csizeof);
-               }
-
                var temp_var = get_temp_variable (expr.value_type, true, expr);
                var name_cnode = get_variable_cexpression (temp_var.name);
                int i = 0;
index 523ec7873d4a53cdcf1645ee96740f523920a48f..e9af7f482c2ccc99b107cb3b99f82c06d4782ad7 100644 (file)
@@ -606,24 +606,16 @@ public class Vala.CCodeAttribute : AttributeCache {
                } else if (node is ErrorType) {
                        return "GError*";
                } else if (node is GenericType) {
-                       if (CodeContext.get ().profile == Profile.GOBJECT) {
-                               var type = (GenericType) node;
-                               if (type.value_owned) {
-                                       return "gpointer";
-                               } else {
-                                       return "gconstpointer";
-                               }
+                       var type = (GenericType) node;
+                       if (type.value_owned) {
+                               return "gpointer";
                        } else {
-                               return "void *";
+                               return "gconstpointer";
                        }
                } else if (node is MethodType) {
                        return "gpointer";
                } else if (node is NullType) {
-                       if (CodeContext.get ().profile == Profile.GOBJECT) {
-                               return "gpointer";
-                       } else {
-                               return "void *";
-                       }
+                       return "gpointer";
                } else if (node is PointerType) {
                        var type = (PointerType) node;
                        if (type.base_type.data_type != null && type.base_type.data_type.is_reference_type ()) {
index 2e0fdedf28dced60fc95b76dc0cc3ad1e7968afc..15a4aa677bf34f9b242d97951a1dee42762baeae 100644 (file)
@@ -440,56 +440,54 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        unichar_type = new IntegerType (unichar_struct);
                }
 
-               if (context.profile == Profile.GOBJECT) {
-                       var glib_ns = root_symbol.scope.lookup ("GLib");
-
-                       gtype_type = (TypeSymbol) glib_ns.scope.lookup ("Type");
-                       gobject_type = (TypeSymbol) glib_ns.scope.lookup ("Object");
-                       gerror_type = new ErrorType (null, null);
-                       glist_type = (Class) glib_ns.scope.lookup ("List");
-                       gslist_type = (Class) glib_ns.scope.lookup ("SList");
-                       gnode_type = (Class) glib_ns.scope.lookup ("Node");
-                       gqueue_type = (Class) glib_ns.scope.lookup ("Queue");
-                       gvaluearray_type = (Class) glib_ns.scope.lookup ("ValueArray");
-                       gstringbuilder_type = (TypeSymbol) glib_ns.scope.lookup ("StringBuilder");
-                       garray_type = (TypeSymbol) glib_ns.scope.lookup ("Array");
-                       gbytearray_type = (TypeSymbol) glib_ns.scope.lookup ("ByteArray");
-                       gptrarray_type = (TypeSymbol) glib_ns.scope.lookup ("PtrArray");
-                       gthreadpool_type = (TypeSymbol) glib_ns.scope.lookup ("ThreadPool");
-                       gdestroynotify_type = new DelegateType ((Delegate) glib_ns.scope.lookup ("DestroyNotify"));
-
-                       gquark_type = new IntegerType ((Struct) glib_ns.scope.lookup ("Quark"));
-                       gvalue_type = (Struct) glib_ns.scope.lookup ("Value");
-                       gvariant_type = (Class) glib_ns.scope.lookup ("Variant");
-                       mutex_type = (Struct) glib_ns.scope.lookup ("StaticRecMutex");
-
-                       if (context.require_glib_version (2, 32)) {
-                               gmutex_type = (Struct) glib_ns.scope.lookup ("Mutex");
-                               grecmutex_type = (Struct) glib_ns.scope.lookup ("RecMutex");
-                               grwlock_type = (Struct) glib_ns.scope.lookup ("RWLock");
-                               gcond_type = (Struct) glib_ns.scope.lookup ("Cond");
-                       }
-
-                       type_module_type = (TypeSymbol) glib_ns.scope.lookup ("TypeModule");
-
-                       regex_type = new ObjectType ((Class) root_symbol.scope.lookup ("GLib").scope.lookup ("Regex"));
-
-                       if (context.module_init_method != null) {
-                               foreach (Parameter parameter in context.module_init_method.get_parameters ()) {
-                                       if (parameter.variable_type.data_type == type_module_type) {
-                                               in_plugin = true;
-                                               module_init_param_name = parameter.name;
-                                               break;
-                                       }
-                               }
-                               if (!in_plugin) {
-                                       Report.error (context.module_init_method.source_reference, "[ModuleInit] requires a parameter of type `GLib.TypeModule'");
+               var glib_ns = root_symbol.scope.lookup ("GLib");
+
+               gtype_type = (TypeSymbol) glib_ns.scope.lookup ("Type");
+               gobject_type = (TypeSymbol) glib_ns.scope.lookup ("Object");
+               gerror_type = new ErrorType (null, null);
+               glist_type = (Class) glib_ns.scope.lookup ("List");
+               gslist_type = (Class) glib_ns.scope.lookup ("SList");
+               gnode_type = (Class) glib_ns.scope.lookup ("Node");
+               gqueue_type = (Class) glib_ns.scope.lookup ("Queue");
+               gvaluearray_type = (Class) glib_ns.scope.lookup ("ValueArray");
+               gstringbuilder_type = (TypeSymbol) glib_ns.scope.lookup ("StringBuilder");
+               garray_type = (TypeSymbol) glib_ns.scope.lookup ("Array");
+               gbytearray_type = (TypeSymbol) glib_ns.scope.lookup ("ByteArray");
+               gptrarray_type = (TypeSymbol) glib_ns.scope.lookup ("PtrArray");
+               gthreadpool_type = (TypeSymbol) glib_ns.scope.lookup ("ThreadPool");
+               gdestroynotify_type = new DelegateType ((Delegate) glib_ns.scope.lookup ("DestroyNotify"));
+
+               gquark_type = new IntegerType ((Struct) glib_ns.scope.lookup ("Quark"));
+               gvalue_type = (Struct) glib_ns.scope.lookup ("Value");
+               gvariant_type = (Class) glib_ns.scope.lookup ("Variant");
+               mutex_type = (Struct) glib_ns.scope.lookup ("StaticRecMutex");
+
+               if (context.require_glib_version (2, 32)) {
+                       gmutex_type = (Struct) glib_ns.scope.lookup ("Mutex");
+                       grecmutex_type = (Struct) glib_ns.scope.lookup ("RecMutex");
+                       grwlock_type = (Struct) glib_ns.scope.lookup ("RWLock");
+                       gcond_type = (Struct) glib_ns.scope.lookup ("Cond");
+               }
+
+               type_module_type = (TypeSymbol) glib_ns.scope.lookup ("TypeModule");
+
+               regex_type = new ObjectType ((Class) root_symbol.scope.lookup ("GLib").scope.lookup ("Regex"));
+
+               if (context.module_init_method != null) {
+                       foreach (Parameter parameter in context.module_init_method.get_parameters ()) {
+                               if (parameter.variable_type.data_type == type_module_type) {
+                                       in_plugin = true;
+                                       module_init_param_name = parameter.name;
+                                       break;
                                }
                        }
-
-                       dbus_proxy_type = (TypeSymbol) glib_ns.scope.lookup ("DBusProxy");
+                       if (!in_plugin) {
+                               Report.error (context.module_init_method.source_reference, "[ModuleInit] requires a parameter of type `GLib.TypeModule'");
+                       }
                }
 
+               dbus_proxy_type = (TypeSymbol) glib_ns.scope.lookup ("DBusProxy");
+
                header_file = new CCodeFile ();
                header_file.is_header = true;
                internal_header_file = new CCodeFile ();
@@ -522,12 +520,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
                // generate C header file for public API
                if (context.header_filename != null) {
-                       bool ret;
-                       if (context.profile == Profile.GOBJECT) {
-                               ret = header_file.store (context.header_filename, null, context.version_header, false, "G_BEGIN_DECLS", "G_END_DECLS");
-                       } else {
-                               ret = header_file.store (context.header_filename, null, context.version_header, false);
-                       }
+                       bool ret = header_file.store (context.header_filename, null, context.version_header, false, "G_BEGIN_DECLS", "G_END_DECLS");
                        if (!ret) {
                                Report.error (null, "unable to open `%s' for writing".printf (context.header_filename));
                        }
@@ -535,12 +528,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
                // generate C header file for internal API
                if (context.internal_header_filename != null) {
-                       bool ret;
-                       if (context.profile == Profile.GOBJECT) {
-                               ret = internal_header_file.store (context.internal_header_filename, null, context.version_header, false, "G_BEGIN_DECLS", "G_END_DECLS");
-                       } else {
-                               ret = internal_header_file.store (context.internal_header_filename, null, context.version_header, false);
-                       }
+                       bool ret = internal_header_file.store (context.internal_header_filename, null, context.version_header, false, "G_BEGIN_DECLS", "G_END_DECLS");
                        if (!ret) {
                                Report.error (null, "unable to open `%s' for writing".printf (context.internal_header_filename));
                        }
@@ -722,12 +710,10 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                wrappers = new HashSet<string> (str_hash, str_equal);
                generated_external_symbols = new HashSet<Symbol> ();
 
-               if (context.profile == Profile.GOBJECT) {
-                       header_file.add_include ("glib.h");
-                       internal_header_file.add_include ("glib.h");
-                       cfile.add_include ("glib.h");
-                       cfile.add_include ("glib-object.h");
-               }
+               header_file.add_include ("glib.h");
+               internal_header_file.add_include ("glib.h");
+               cfile.add_include ("glib.h");
+               cfile.add_include ("glib-object.h");
 
                source_file.accept_children (this);
 
@@ -3004,7 +2990,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public CCodeExpression? get_destroy_func_expression (DataType type, bool is_chainup = false) {
-               if (context.profile == Profile.GOBJECT && (type.data_type == glist_type || type.data_type == gslist_type || type.data_type == gnode_type || type.data_type == gqueue_type)) {
+               if (type.data_type == glist_type || type.data_type == gslist_type || type.data_type == gnode_type || type.data_type == gqueue_type) {
                        // create wrapper function to free list elements if necessary
 
                        bool elements_require_free = false;
@@ -3088,17 +3074,9 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                return get_variable_cexpression (func_name);
                        }
                } else if (type is ArrayType) {
-                       if (context.profile == Profile.POSIX) {
-                               return new CCodeIdentifier ("free");
-                       } else {
-                               return new CCodeIdentifier ("g_free");
-                       }
+                       return new CCodeIdentifier ("g_free");
                } else if (type is PointerType) {
-                       if (context.profile == Profile.POSIX) {
-                               return new CCodeIdentifier ("free");
-                       } else {
-                               return new CCodeIdentifier ("g_free");
-                       }
+                       return new CCodeIdentifier ("g_free");
                } else {
                        return new CCodeConstant ("NULL");
                }
@@ -3299,42 +3277,40 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                /* set freed references to NULL to prevent further use */
                var ccomma = new CCodeCommaExpression ();
 
-               if (context.profile == Profile.GOBJECT) {
-                       if (type.data_type != null && !is_reference_counting (type.data_type) &&
-                           (type.data_type.is_subtype_of (gstringbuilder_type)
-                            || type.data_type.is_subtype_of (garray_type)
-                            || type.data_type.is_subtype_of (gbytearray_type)
-                            || type.data_type.is_subtype_of (gptrarray_type))) {
-                               ccall.add_argument (new CCodeConstant ("TRUE"));
-                       } else if (type.data_type == gthreadpool_type) {
-                               ccall.add_argument (new CCodeConstant ("FALSE"));
-                               ccall.add_argument (new CCodeConstant ("TRUE"));
-                       } else if (type is ArrayType) {
-                               var array_type = (ArrayType) type;
-                               if (requires_destroy (array_type.element_type)) {
-                                       CCodeExpression csizeexpr = null;
-                                       if (((GLibValue) value).array_length_cvalues != null) {
-                                               csizeexpr = get_array_length_cvalue (value);
-                                       } else if (get_array_null_terminated (value)) {
-                                               requires_array_length = true;
-                                               var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length"));
-                                               len_call.add_argument (cvar);
-                                               csizeexpr = len_call;
-                                       } else {
-                                               csizeexpr = get_array_length_cexpr (value);
-                                       }
+               if (type.data_type != null && !is_reference_counting (type.data_type) &&
+                   (type.data_type.is_subtype_of (gstringbuilder_type)
+                    || type.data_type.is_subtype_of (garray_type)
+                    || type.data_type.is_subtype_of (gbytearray_type)
+                    || type.data_type.is_subtype_of (gptrarray_type))) {
+                       ccall.add_argument (new CCodeConstant ("TRUE"));
+               } else if (type.data_type == gthreadpool_type) {
+                       ccall.add_argument (new CCodeConstant ("FALSE"));
+                       ccall.add_argument (new CCodeConstant ("TRUE"));
+               } else if (type is ArrayType) {
+                       var array_type = (ArrayType) type;
+                       if (requires_destroy (array_type.element_type)) {
+                               CCodeExpression csizeexpr = null;
+                               if (((GLibValue) value).array_length_cvalues != null) {
+                                       csizeexpr = get_array_length_cvalue (value);
+                               } else if (get_array_null_terminated (value)) {
+                                       requires_array_length = true;
+                                       var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length"));
+                                       len_call.add_argument (cvar);
+                                       csizeexpr = len_call;
+                               } else {
+                                       csizeexpr = get_array_length_cexpr (value);
+                               }
 
-                                       if (csizeexpr != null) {
-                                               var st = array_type.element_type.data_type as Struct;
-                                               if (st != null && !array_type.element_type.nullable) {
-                                                       ccall.call = new CCodeIdentifier (append_struct_array_free (st));
-                                                       ccall.add_argument (csizeexpr);
-                                               } else {
-                                                       requires_array_free = true;
-                                                       ccall.call = new CCodeIdentifier ("_vala_array_free");
-                                                       ccall.add_argument (csizeexpr);
-                                                       ccall.add_argument (new CCodeCastExpression (get_destroy_func_expression (array_type.element_type), "GDestroyNotify"));
-                                               }
+                               if (csizeexpr != null) {
+                                       var st = array_type.element_type.data_type as Struct;
+                                       if (st != null && !array_type.element_type.nullable) {
+                                               ccall.call = new CCodeIdentifier (append_struct_array_free (st));
+                                               ccall.add_argument (csizeexpr);
+                                       } else {
+                                               requires_array_free = true;
+                                               ccall.call = new CCodeIdentifier ("_vala_array_free");
+                                               ccall.add_argument (csizeexpr);
+                                               ccall.add_argument (new CCodeCastExpression (get_destroy_func_expression (array_type.element_type), "GDestroyNotify"));
                                        }
                                }
                        }
@@ -3777,12 +3753,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public override void visit_boolean_literal (BooleanLiteral expr) {
-               if (context.profile == Profile.GOBJECT) {
-                       set_cvalue (expr, new CCodeConstant (expr.value ? "TRUE" : "FALSE"));
-               } else {
-                       cfile.add_include ("stdbool.h");
-                       set_cvalue (expr, new CCodeConstant (expr.value ? "true" : "false"));
-               }
+               set_cvalue (expr, new CCodeConstant (expr.value ? "TRUE" : "FALSE"));
        }
 
        public override void visit_character_literal (CharacterLiteral expr) {
@@ -3895,9 +3866,6 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public override void visit_null_literal (NullLiteral expr) {
-               if (context.profile != Profile.GOBJECT) {
-                       cfile.add_include ("stddef.h");
-               }
                set_cvalue (expr, new CCodeConstant ("NULL"));
 
                var array_type = expr.target_type as ArrayType;
@@ -4157,9 +4125,6 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                dup0_func = dupid.name;
                        } else if (add_wrapper (dup0_func)) {
                                string pointer_cname = "gpointer";
-                               if (context.profile == Profile.POSIX) {
-                                       pointer_cname = "void*";
-                               }
                                var dup0_fun = new CCodeFunction (dup0_func, pointer_cname);
                                dup0_fun.add_parameter (new CCodeParameter ("self", pointer_cname));
                                dup0_fun.modifiers = CCodeModifiers.STATIC;
@@ -5010,7 +4975,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
                var cl = expr.type_reference.data_type as Class;
                var iface = expr.type_reference.data_type as Interface;
-               if (context.profile == Profile.GOBJECT && (iface != null || (cl != null && !cl.is_compact))) {
+               if (iface != null || (cl != null && !cl.is_compact)) {
                        // checked cast for strict subtypes of GTypeInstance
                        if (expr.is_silent_cast) {
                                var cexpr = get_cvalue (expr.inner);
@@ -5251,38 +5216,16 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                        set_cvalue (expr, new CCodeConstant ("%s %s".printf (left, right)));
                                        return;
                                } else {
-                                       if (context.profile == Profile.POSIX) {
-                                               // convert to strcat(strcpy(malloc(1+strlen(a)+strlen(b)),a),b)
-                                               var strcat = new CCodeFunctionCall (new CCodeIdentifier ("strcat"));
-                                               var strcpy = new CCodeFunctionCall (new CCodeIdentifier ("strcpy"));
-                                               var malloc = new CCodeFunctionCall (new CCodeIdentifier ("malloc"));
-
-                                               var strlen_a = new CCodeFunctionCall (new CCodeIdentifier ("strlen"));
-                                               strlen_a.add_argument(cleft);
-                                               var strlen_b = new CCodeFunctionCall (new CCodeIdentifier ("strlen"));
-                                               strlen_b.add_argument(cright);
-                                               var newlength = new CCodeBinaryExpression (CCodeBinaryOperator.PLUS, new CCodeIdentifier("1"),
-                                                       new CCodeBinaryExpression (CCodeBinaryOperator.PLUS, strlen_a, strlen_b));
-                                               malloc.add_argument(newlength);
-
-                                               strcpy.add_argument(malloc);
-                                               strcpy.add_argument(cleft);
-
-                                               strcat.add_argument(strcpy);
-                                               strcat.add_argument(cright);
-                                               set_cvalue (expr, strcat);
-                                       } else {
-                                               // convert to g_strconcat (a, b, NULL)
-                                               var temp_value = create_temp_value (expr.value_type, false, expr);
+                                       // convert to g_strconcat (a, b, NULL)
+                                       var temp_value = create_temp_value (expr.value_type, false, expr);
 
-                                               var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_strconcat"));
-                                               ccall.add_argument (cleft);
-                                               ccall.add_argument (cright);
-                                               ccall.add_argument (new CCodeConstant("NULL"));
+                                       var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_strconcat"));
+                                       ccall.add_argument (cleft);
+                                       ccall.add_argument (cright);
+                                       ccall.add_argument (new CCodeConstant("NULL"));
 
-                                               ccode.add_assignment (get_cvalue_ (temp_value), ccall);
-                                               expr.target_value = temp_value;
-                                       }
+                                       ccode.add_assignment (get_cvalue_ (temp_value), ccall);
+                                       expr.target_value = temp_value;
                                        return;
                                }
                        } else if (expr.operator == BinaryOperator.EQUALITY
@@ -5507,13 +5450,11 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                bool unboxing = (type is ValueType && type.nullable
                                 && target_type is ValueType && !target_type.nullable);
 
-               bool gvalue_boxing = (context.profile == Profile.GOBJECT
-                                     && target_type != null
+               bool gvalue_boxing = (target_type != null
                                      && target_type.data_type == gvalue_type
                                      && !(type is NullType)
                                      && get_ccode_type_id (type) != "G_TYPE_VALUE");
-               bool gvariant_boxing = (context.profile == Profile.GOBJECT
-                                       && target_type != null
+               bool gvariant_boxing = (target_type != null
                                        && target_type.data_type == gvariant_type
                                        && !(type is NullType)
                                        && type.data_type != gvariant_type);
index 09ab3d619501e2aed1b08b971bb726836562f9bf..b192760fea75b0ad3c83b9637682c73f93d513c6 100644 (file)
@@ -55,12 +55,10 @@ public class Vala.CCodeCompiler {
                if (!context.compile_only) {
                        pc += " --libs";
                }
-               if (context.profile == Profile.GOBJECT) {
-                       use_pkgconfig = true;
-                       pc += " gobject-2.0";
-                       if (context.thread) {
-                               pc += " gthread-2.0";
-                       }
+               use_pkgconfig = true;
+               pc += " gobject-2.0";
+               if (context.thread) {
+                       pc += " gthread-2.0";
                }
                foreach (string pkg in context.get_packages ()) {
                        if (package_exists (pkg)) {
index ea64522489eb2373e0d06dbdab4f4e16252f2bd1..91268e7d1112595b55fca5bd6efd32a77255a06e 100644 (file)
@@ -206,12 +206,7 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule {
        }
 
        public override void visit_loop (Loop stmt) {
-               if (context.profile == Profile.GOBJECT) {
-                       ccode.open_while (new CCodeConstant ("TRUE"));
-               } else {
-                       cfile.add_include ("stdbool.h");
-                       ccode.open_while (new CCodeConstant ("true"));
-               }
+               ccode.open_while (new CCodeConstant ("TRUE"));
 
                stmt.body.emit (this);
 
index f164ae1c6a466c83619a8097e95f2816738286a9..bd816092692f1b3c666a24507771703875e8db62 100644 (file)
@@ -48,8 +48,6 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                // Enum.VALUE.to_string()
                                var en = (Enum) ma.inner.value_type.data_type;
                                ccall.call = new CCodeIdentifier (generate_enum_tostring_function (en));
-                       } else if (context.profile == Profile.POSIX && ma.inner != null && ma.inner.value_type != null && ma.inner.value_type.data_type == string_type.data_type && ma.member_name == "printf") {
-                               ccall.call = new CCodeIdentifier (generate_string_printf_function ());
                        }
                } else if (itype is SignalType) {
                        var sig_type = (SignalType) itype;
@@ -123,12 +121,8 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                }
 
                if (m is CreationMethod && m.parent_symbol is Class) {
-                       if (context.profile == Profile.GOBJECT) {
-                               if (!((Class) m.parent_symbol).is_compact) {
-                                       ccall.add_argument (get_variable_cexpression ("object_type"));
-                               }
-                       } else {
-                               ccall.add_argument (get_this_cexpression ());
+                       if (!((Class) m.parent_symbol).is_compact) {
+                               ccall.add_argument (get_variable_cexpression ("object_type"));
                        }
 
                        if (!current_class.is_compact) {
@@ -281,7 +275,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                param.accept (this);
                        }
                        generate_dynamic_method_wrapper ((DynamicMethod) m);
-               } else if (m is CreationMethod && context.profile == Profile.GOBJECT && m.parent_symbol is Class) {
+               } else if (m is CreationMethod && m.parent_symbol is Class) {
                        ccode.add_assignment (get_this_cexpression (), new CCodeCastExpression (ccall, CCodeBaseModule.get_ccode_name (current_class) + "*"));
 
                        if (current_method.body.captured) {
@@ -837,80 +831,5 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
 
                return to_string_func;
        }
-
-       private string generate_string_printf_function () {
-               if (!add_wrapper ("string_printf")) {
-                       // wrapper already defined
-                       return "string_printf";
-               }
-
-               // declaration
-               var function = new CCodeFunction ("string_printf", "char*");
-               function.add_parameter (new CCodeParameter ("format", "const char*"));
-               function.add_parameter (new CCodeParameter.with_ellipsis ());
-               function.modifiers = CCodeModifiers.STATIC;
-
-               // definition
-               push_context (new EmitContext ());
-               push_function (function);
-
-               ccode.add_declaration ("int", new CCodeVariableDeclarator ("length"));
-               ccode.add_declaration ("va_list", new CCodeVariableDeclarator ("ap"));
-               ccode.add_declaration ("char*", new CCodeVariableDeclarator ("result"));
-
-               var va_start = new CCodeFunctionCall (new CCodeIdentifier ("va_start"));
-               va_start.add_argument (new CCodeIdentifier ("ap"));
-               va_start.add_argument (new CCodeIdentifier ("format"));
-
-               ccode.add_expression (va_start);
-
-               var vsnprintf = new CCodeFunctionCall (new CCodeIdentifier ("vsnprintf"));
-               vsnprintf.add_argument (new CCodeConstant ("NULL"));
-               vsnprintf.add_argument (new CCodeConstant ("0"));
-               vsnprintf.add_argument (new CCodeIdentifier ("format"));
-               vsnprintf.add_argument (new CCodeIdentifier ("ap"));
-
-               ccode.add_assignment (new CCodeIdentifier ("length"), new CCodeBinaryExpression (CCodeBinaryOperator.PLUS, vsnprintf, new CCodeConstant ("1")));
-
-               var va_end = new CCodeFunctionCall (new CCodeIdentifier ("va_end"));
-               va_end.add_argument (new CCodeIdentifier ("ap"));
-
-               ccode.add_expression (va_end);
-
-               var malloc = new CCodeFunctionCall (new CCodeIdentifier ("malloc"));
-               malloc.add_argument (new CCodeIdentifier ("length"));
-
-               ccode.add_assignment (new CCodeIdentifier ("result"), malloc);
-
-               va_start = new CCodeFunctionCall (new CCodeIdentifier ("va_start"));
-               va_start.add_argument (new CCodeIdentifier ("ap"));
-               va_start.add_argument (new CCodeIdentifier ("format"));
-
-               ccode.add_expression (va_start);
-
-               vsnprintf = new CCodeFunctionCall (new CCodeIdentifier ("vsnprintf"));
-               vsnprintf.add_argument (new CCodeIdentifier ("result"));
-               vsnprintf.add_argument (new CCodeIdentifier ("length"));
-               vsnprintf.add_argument (new CCodeIdentifier ("format"));
-               vsnprintf.add_argument (new CCodeIdentifier ("ap"));
-
-               ccode.add_expression (vsnprintf);
-
-               va_end = new CCodeFunctionCall (new CCodeIdentifier ("va_end"));
-               va_end.add_argument (new CCodeIdentifier ("ap"));
-
-               ccode.add_expression (va_end);
-
-               ccode.add_return (new CCodeIdentifier ("result"));
-
-               // append to file
-               cfile.add_include ("stdarg.h");
-               cfile.add_function_declaration (function);
-               cfile.add_function (function);
-
-               pop_context ();
-
-               return "string_printf";
-       }
 }
 
index a784ab30eb66ec411771f6242032181c9495d11c..a4254902168ee77f3d6b2b4f7aa5d4541f722a7e 100644 (file)
@@ -827,24 +827,22 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                        cmain.add_parameter (new CCodeParameter ("argv", "char **"));
                        push_function (cmain);
 
-                       if (context.profile == Profile.GOBJECT) {
-                               if (context.mem_profiler) {
-                                       var mem_profiler_init_call = new CCodeFunctionCall (new CCodeIdentifier ("g_mem_set_vtable"));
-                                       mem_profiler_init_call.line = cmain.line;
-                                       mem_profiler_init_call.add_argument (new CCodeConstant ("glib_mem_profiler_table"));
-                                       ccode.add_expression (mem_profiler_init_call);
-                               }
-
-                               if (context.thread) {
-                                       var thread_init_call = new CCodeFunctionCall (new CCodeIdentifier ("g_thread_init"));
-                                       thread_init_call.line = cmain.line;
-                                       thread_init_call.add_argument (new CCodeConstant ("NULL"));
-                                       ccode.add_expression (thread_init_call);
-                               }
+                       if (context.mem_profiler) {
+                               var mem_profiler_init_call = new CCodeFunctionCall (new CCodeIdentifier ("g_mem_set_vtable"));
+                               mem_profiler_init_call.line = cmain.line;
+                               mem_profiler_init_call.add_argument (new CCodeConstant ("glib_mem_profiler_table"));
+                               ccode.add_expression (mem_profiler_init_call);
+                       }
 
-                               ccode.add_expression (new CCodeFunctionCall (new CCodeIdentifier ("g_type_init")));
+                       if (context.thread) {
+                               var thread_init_call = new CCodeFunctionCall (new CCodeIdentifier ("g_thread_init"));
+                               thread_init_call.line = cmain.line;
+                               thread_init_call.add_argument (new CCodeConstant ("NULL"));
+                               ccode.add_expression (thread_init_call);
                        }
 
+                       ccode.add_expression (new CCodeFunctionCall (new CCodeIdentifier ("g_type_init")));
+
                        var main_call = new CCodeFunctionCall (new CCodeIdentifier (function.name));
                        if (m.get_parameters ().size == 1) {
                                main_call.add_argument (new CCodeIdentifier ("argv"));
index 75b14bdad53ac8586f02fdeee2a86dcd7598299b..df3393951ca153020fd756a487f4d1c6535ffe7d 100644 (file)
@@ -53,16 +53,14 @@ public abstract class Vala.CCodeStructModule : CCodeBaseModule {
                        return;
                }
 
-               if (context.profile == Profile.GOBJECT) {
-                       if (get_ccode_has_type_id (st)) {
-                               decl_space.add_type_declaration (new CCodeNewline ());
-                               var macro = "(%s_get_type ())".printf (get_ccode_lower_case_name (st, null));
-                               decl_space.add_type_declaration (new CCodeMacroReplacement (get_ccode_type_id (st), macro));
-
-                               var type_fun = new StructRegisterFunction (st, context);
-                               type_fun.init_from_type (false, true);
-                               decl_space.add_type_member_declaration (type_fun.get_declaration ());
-                       }
+               if (get_ccode_has_type_id (st)) {
+                       decl_space.add_type_declaration (new CCodeNewline ());
+                       var macro = "(%s_get_type ())".printf (get_ccode_lower_case_name (st, null));
+                       decl_space.add_type_declaration (new CCodeMacroReplacement (get_ccode_type_id (st), macro));
+
+                       var type_fun = new StructRegisterFunction (st, context);
+                       type_fun.init_from_type (false, true);
+                       decl_space.add_type_member_declaration (type_fun.get_declaration ());
                }
 
                var instance_struct = new CCodeStruct ("_%s".printf (get_ccode_name (st)));
@@ -204,17 +202,10 @@ public abstract class Vala.CCodeStructModule : CCodeBaseModule {
 
                ccode.add_declaration (get_ccode_name (st) + "*", new CCodeVariableDeclarator ("dup"));
 
-               if (context.profile == Profile.GOBJECT) {
-                       var creation_call = new CCodeFunctionCall (new CCodeIdentifier ("g_new0"));
-                       creation_call.add_argument (new CCodeConstant (get_ccode_name (st)));
-                       creation_call.add_argument (new CCodeConstant ("1"));
-                       ccode.add_assignment (new CCodeIdentifier ("dup"), creation_call);
-               } else if (context.profile == Profile.POSIX) {
-                       var creation_call = new CCodeFunctionCall (new CCodeIdentifier ("calloc"));
-                       creation_call.add_argument (new CCodeConstant ("1"));
-                       creation_call.add_argument (new CCodeIdentifier ("sizeof (%s*)".printf (get_ccode_name (st))));
-                       ccode.add_assignment (new CCodeIdentifier ("dup"), creation_call);
-               }
+               var creation_call = new CCodeFunctionCall (new CCodeIdentifier ("g_new0"));
+               creation_call.add_argument (new CCodeConstant (get_ccode_name (st)));
+               creation_call.add_argument (new CCodeConstant ("1"));
+               ccode.add_assignment (new CCodeIdentifier ("dup"), creation_call);
 
                if (st.is_disposable ()) {
                        var copy_call = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_copy_function (st)));
@@ -257,15 +248,9 @@ public abstract class Vala.CCodeStructModule : CCodeBaseModule {
                        ccode.add_expression (destroy_call);
                }
 
-               if (context.profile == Profile.GOBJECT) {
-                       var free_call = new CCodeFunctionCall (new CCodeIdentifier ("g_free"));
-                       free_call.add_argument (new CCodeIdentifier ("self"));
-                       ccode.add_expression (free_call);
-               } else if (context.profile == Profile.POSIX) {
-                       var free_call = new CCodeFunctionCall (new CCodeIdentifier ("free"));
-                       free_call.add_argument (new CCodeIdentifier ("self"));
-                       ccode.add_expression (free_call);
-               }
+               var free_call = new CCodeFunctionCall (new CCodeIdentifier ("g_free"));
+               free_call.add_argument (new CCodeIdentifier ("self"));
+               ccode.add_expression (free_call);
 
                pop_function ();
 
index 830c8b9ebca77827946cbdb4ba884a2ae11b00fb..c30614f0850fbfa480eeb3132507fee02007c1cd 100644 (file)
@@ -207,10 +207,7 @@ class Vala.Compiler {
                context.thread = thread;
                context.mem_profiler = mem_profiler;
                context.save_temps = save_temps;
-               if (profile == "posix") {
-                       context.profile = Profile.POSIX;
-                       context.add_define ("POSIX");
-               } else if (profile == "gobject-2.0" || profile == "gobject" || profile == null) {
+               if (profile == "gobject-2.0" || profile == "gobject" || profile == null) {
                        // default profile
                        context.profile = Profile.GOBJECT;
                        context.add_define ("GOBJECT");
@@ -234,33 +231,26 @@ class Vala.Compiler {
                        context.add_define ("VALA_0_%d".printf (i));
                }
 
-               if (context.profile == Profile.POSIX) {
-                       if (!nostdpkg) {
-                               /* default package */
-                               context.add_external_package ("posix");
-                       }
-               } else if (context.profile == Profile.GOBJECT) {
-                       int glib_major = 2;
-                       int glib_minor = 18;
-                       if (target_glib != null && target_glib.scanf ("%d.%d", out glib_major, out glib_minor) != 2) {
-                               Report.error (null, "Invalid format for --target-glib");
-                       }
+               int glib_major = 2;
+               int glib_minor = 18;
+               if (target_glib != null && target_glib.scanf ("%d.%d", out glib_major, out glib_minor) != 2) {
+                       Report.error (null, "Invalid format for --target-glib");
+               }
 
-                       context.target_glib_major = glib_major;
-                       context.target_glib_minor = glib_minor;
-                       if (context.target_glib_major != 2) {
-                               Report.error (null, "This version of valac only supports GLib 2");
-                       }
+               context.target_glib_major = glib_major;
+               context.target_glib_minor = glib_minor;
+               if (context.target_glib_major != 2) {
+                       Report.error (null, "This version of valac only supports GLib 2");
+               }
 
-                       for (int i = 16; i <= glib_minor; i += 2) {
-                               context.add_define ("GLIB_2_%d".printf (i));
-                       }
+               for (int i = 16; i <= glib_minor; i += 2) {
+                       context.add_define ("GLIB_2_%d".printf (i));
+               }
 
-                       if (!nostdpkg) {
-                               /* default packages */
-                               context.add_external_package ("glib-2.0");
-                               context.add_external_package ("gobject-2.0");
-                       }
+               if (!nostdpkg) {
+                       /* default packages */
+                       context.add_external_package ("glib-2.0");
+                       context.add_external_package ("gobject-2.0");
                }
 
                if (packages != null) {
@@ -282,11 +272,7 @@ class Vala.Compiler {
                        return quit ();
                }
 
-               if (context.profile == Profile.GOBJECT) {
-                       context.codegen = new GDBusServerModule ();
-               } else {
-                       context.codegen = new CCodeDelegateModule ();
-               }
+               context.codegen = new GDBusServerModule ();
 
                bool has_c_files = false;
 
@@ -357,29 +343,27 @@ class Vala.Compiler {
 
                if (library != null) {
                        if (gir != null) {
-                               if (context.profile == Profile.GOBJECT) {
-                                       long gir_len = gir.length;
-                                       int last_hyphen = gir.last_index_of_char ('-');
-
-                                       if (last_hyphen == -1 || !gir.has_suffix (".gir")) {
+                               long gir_len = gir.length;
+                               int last_hyphen = gir.last_index_of_char ('-');
+
+                               if (last_hyphen == -1 || !gir.has_suffix (".gir")) {
+                                       Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir));
+                               } else {
+                                       string gir_namespace = gir.substring (0, last_hyphen);
+                                       string gir_version = gir.substring (last_hyphen + 1, gir_len - last_hyphen - 5);
+                                       gir_version.canon ("0123456789.", '?');
+                                       if (gir_namespace == "" || gir_version == "" || !gir_version[0].isdigit () || gir_version.contains ("?")) {
                                                Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir));
                                        } else {
-                                               string gir_namespace = gir.substring (0, last_hyphen);
-                                               string gir_version = gir.substring (last_hyphen + 1, gir_len - last_hyphen - 5);
-                                               gir_version.canon ("0123456789.", '?');
-                                               if (gir_namespace == "" || gir_version == "" || !gir_version[0].isdigit () || gir_version.contains ("?")) {
-                                                       Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir));
-                                               } else {
-                                                       var gir_writer = new GIRWriter ();
-
-                                                       // put .gir file in current directory unless -d has been explicitly specified
-                                                       string gir_directory = ".";
-                                                       if (directory != null) {
-                                                               gir_directory = context.directory;
-                                                       }
-
-                                                       gir_writer.write_file (context, gir_directory, gir_namespace, gir_version, library);
+                                               var gir_writer = new GIRWriter ();
+
+                                               // put .gir file in current directory unless -d has been explicitly specified
+                                               string gir_directory = ".";
+                                               if (directory != null) {
+                                                       gir_directory = context.directory;
                                                }
+
+                                               gir_writer.write_file (context, gir_directory, gir_namespace, gir_version, library);
                                        }
                                }
 
index c190d1d848e367b792313c15ba75b92de84d0cc0..6654870838ac12bf0631a53679f22dc16a2f2dbc 100644 (file)
@@ -157,7 +157,7 @@ public class Vala.ArrayType : ReferenceType {
        }
 
        public override bool compatible (DataType target_type) {
-               if (CodeContext.get ().profile == Profile.GOBJECT && target_type.data_type != null) {
+               if (target_type.data_type != null) {
                        if (target_type.data_type.is_subtype_of (CodeContext.get ().analyzer.gvalue_type.data_type) && element_type.data_type == CodeContext.get ().root.scope.lookup ("string")) {
                                // allow implicit conversion from string[] to GValue
                                return true;
index a65d74997681ac86da797ab21c95a608a4d90dc1..b2f20a49194dbf767c015a9eea72427376327550 100644 (file)
@@ -127,11 +127,7 @@ public class Vala.CatchClause : CodeNode {
                        }
                } else {
                        // generic catch clause
-                       if (context.profile == Profile.GOBJECT) {
-                               error_type = new ErrorType (null, null, source_reference);
-                       } else {
-                               error_type = context.analyzer.error_type;
-                       }
+                       error_type = new ErrorType (null, null, source_reference);
                }
 
                error_type.check (context);
index 6167b55973c19f0871d245b754021b73e5e031c0..e68cf416c565fb52405ebb7cf4918b08927ce2d9 100644 (file)
@@ -407,17 +407,10 @@ public class Vala.CodeContext {
                        var source_file = new SourceFile (this, SourceFileType.SOURCE, rpath, null, cmdline);
                        source_file.relative_filename = filename;
 
-                       if (profile == Profile.POSIX) {
-                               // import the Posix namespace by default (namespace of backend-specific standard library)
-                               var ns_ref = new UsingDirective (new UnresolvedSymbol (null, "Posix", null));
-                               source_file.add_using_directive (ns_ref);
-                               root.add_using_directive (ns_ref);
-                       } else if (profile == Profile.GOBJECT) {
-                               // import the GLib namespace by default (namespace of backend-specific standard library)
-                               var ns_ref = new UsingDirective (new UnresolvedSymbol (null, "GLib", null));
-                               source_file.add_using_directive (ns_ref);
-                               root.add_using_directive (ns_ref);
-                       }
+                       // import the GLib namespace by default (namespace of backend-specific standard library)
+                       var ns_ref = new UsingDirective (new UnresolvedSymbol (null, "GLib", null));
+                       source_file.add_using_directive (ns_ref);
+                       root.add_using_directive (ns_ref);
 
                        add_source_file (source_file);
                } else if (filename.has_suffix (".vapi") || filename.has_suffix (".gir")) {
index 826a0db90d32f46db32ef115c478831134cbec24..451dd813d7a88a07624072d3d38e72d81390e1f2 100644 (file)
@@ -122,8 +122,7 @@ public class Vala.CreationMethod : Method {
 
                        // ensure we chain up to base constructor
                        if (!chain_up && cl != null && cl.base_class != null) {
-                               if (context.profile == Profile.GOBJECT
-                                   && cl.base_class.default_construction_method != null
+                               if (cl.base_class.default_construction_method != null
                                    && !cl.base_class.default_construction_method.has_construct_function) {
                                        // directly chain up to Object
                                        var old_insert_block = context.analyzer.insert_block;
index e48d12d2d8ae5052f4da6b663f4f535fb632ab4e..085d321e0519302ff1a0da8c50a2a7c130b422e2 100644 (file)
@@ -262,7 +262,7 @@ public abstract class Vala.DataType : CodeNode {
                        return false;
                }
 
-               if (CodeContext.get ().profile == Profile.GOBJECT && target_type.data_type != null) {
+               if (target_type.data_type != null) {
                        if (target_type.data_type.is_subtype_of (CodeContext.get ().analyzer.gvalue_type.data_type)) {
                                // allow implicit conversion to GValue
                                return true;
index 8210e47e69fa958f80fe531a602a07a7e95372f3..a86a077bb00ff0b717268b26a3bf3fac307a9fc2 100644 (file)
@@ -141,7 +141,7 @@ public class Vala.ElementAccess : Expression {
                                value_type.value_owned = false;
                        } else {
                                var ma = container as MemberAccess;
-                               if (context.profile == Profile.GOBJECT && ma != null && ma.symbol_reference is ArrayLengthField) {
+                               if (ma != null && ma.symbol_reference is ArrayLengthField) {
                                        // propagate lvalue for gobject length access
                                        ma.inner.lvalue = true;
                                        ((MemberAccess) ma.inner).check_lvalue_access ();
index 57453ee03c23921a81778d76a47395b24abf11e9..b059bbd64b0ac03b12edfa3b1e6d5d8ffedf7d94 100644 (file)
@@ -847,7 +847,6 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                        // exceptional control flow
                        foreach (DataType error_data_type in node.get_error_types()) {
                                var error_type = error_data_type as ErrorType;
-                               var error_class = error_data_type.data_type as Class;
                                current_block = last_block;
                                unreachable_reported = true;
 
@@ -858,32 +857,19 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                                                mark_unreachable ();
                                                break;
                                        } else if (jump_target.is_error_target) {
-                                               if (context.profile == Profile.GOBJECT) {
-                                                       if (jump_target.error_domain == null
-                                                           || (jump_target.error_domain == error_type.error_domain
-                                                               && (jump_target.error_code == null
-                                                                   || jump_target.error_code == error_type.error_code))) {
-                                                               // error can always be caught by this catch clause
-                                                               // following catch clauses cannot be reached by this error
-                                                               current_block.connect (jump_target.basic_block);
-                                                               mark_unreachable ();
-                                                               break;
-                                                       } else if (error_type.error_domain == null
-                                                                  || (error_type.error_domain == jump_target.error_domain
-                                                                      && (error_type.error_code == null
-                                                                          || error_type.error_code == jump_target.error_code))) {
-                                                               // error might be caught by this catch clause
-                                                               // unknown at compile time
-                                                               // following catch clauses might still be reached by this error
-                                                               current_block.connect (jump_target.basic_block);
-                                                       }
-                                               } else if (jump_target.error_class == null || jump_target.error_class == error_class) {
+                                               if (jump_target.error_domain == null
+                                                   || (jump_target.error_domain == error_type.error_domain
+                                                       && (jump_target.error_code == null
+                                                           || jump_target.error_code == error_type.error_code))) {
                                                        // error can always be caught by this catch clause
                                                        // following catch clauses cannot be reached by this error
                                                        current_block.connect (jump_target.basic_block);
                                                        mark_unreachable ();
                                                        break;
-                                               } else if (jump_target.error_class.is_subtype_of (error_class)) {
+                                               } else if (error_type.error_domain == null
+                                                          || (error_type.error_domain == jump_target.error_domain
+                                                              && (error_type.error_code == null
+                                                                  || error_type.error_code == jump_target.error_code))) {
                                                        // error might be caught by this catch clause
                                                        // unknown at compile time
                                                        // following catch clauses might still be reached by this error
@@ -957,13 +943,8 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                for (int i = catch_clauses.size - 1; i >= 0; i--) {
                        var catch_clause = catch_clauses[i];
                        if (catch_clause.error_type != null) {
-                               if (context.profile == Profile.GOBJECT) {
-                                       var error_type = catch_clause.error_type as ErrorType;
-                                       jump_stack.add (new JumpTarget.error_target (new BasicBlock (), catch_clause, catch_clause.error_type.data_type as ErrorDomain, error_type.error_code, null));
-                               } else {
-                                       var error_class = catch_clause.error_type.data_type as Class;
-                                       jump_stack.add (new JumpTarget.error_target (new BasicBlock (), catch_clause, null, null, error_class));
-                               }
+                               var error_type = catch_clause.error_type as ErrorType;
+                               jump_stack.add (new JumpTarget.error_target (new BasicBlock (), catch_clause, catch_clause.error_type.data_type as ErrorDomain, error_type.error_code, null));
                        } else {
                                jump_stack.add (new JumpTarget.error_target (new BasicBlock (), catch_clause, null, null, null));
                        }
@@ -996,14 +977,8 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                                        break;
                                }
 
-                               if (context.profile == Profile.GOBJECT) {
-                                       if (prev_target.error_domain == jump_target.error_domain &&
-                                           prev_target.error_code == jump_target.error_code) {
-                                               Report.error (stmt.source_reference, "double catch clause of same error detected");
-                                               stmt.error = true;
-                                               return;
-                                       }
-                               } else if (prev_target.error_class == jump_target.error_class) {
+                               if (prev_target.error_domain == jump_target.error_domain &&
+                                   prev_target.error_code == jump_target.error_code) {
                                        Report.error (stmt.source_reference, "double catch clause of same error detected");
                                        stmt.error = true;
                                        return;
index f27e30371ca6121e3bce0654fe8bf930520fe1db..8c6522229763a83c4354261ff9b37c14c0096b4c 100644 (file)
@@ -174,7 +174,7 @@ public class Vala.ForeachStatement : Block {
                        array_type.inline_allocated = false;
 
                        return check_without_iterator (context, collection_type, array_type.element_type);
-               } else if (context.profile == Profile.GOBJECT && (collection_type.compatible (context.analyzer.glist_type) || collection_type.compatible (context.analyzer.gslist_type))) {
+               } else if (collection_type.compatible (context.analyzer.glist_type) || collection_type.compatible (context.analyzer.gslist_type)) {
                        if (collection_type.get_type_arguments ().size != 1) {
                                error = true;
                                Report.error (collection.source_reference, "missing type argument for collection");
@@ -182,7 +182,7 @@ public class Vala.ForeachStatement : Block {
                        }
 
                        return check_without_iterator (context, collection_type, collection_type.get_type_arguments ().get (0));
-               } else if (context.profile == Profile.GOBJECT && collection_type.compatible (context.analyzer.gvaluearray_type)) {
+               } else if (collection_type.compatible (context.analyzer.gvaluearray_type)) {
                        return check_without_iterator (context, collection_type, context.analyzer.gvalue_type);
                } else {
                        return check_with_iterator (context, collection_type);
index 861fe0d09d574ba1aa02dfe4b804c8f0fb09b4d7..fe23c5f40659e1f4fedcbc151d1ad3cfb173e454 100644 (file)
@@ -2341,11 +2341,8 @@ public class Vala.Genie.Parser : CodeVisitor {
                        if (is_root) {
                                return parse_main_method_declaration (attrs);
                        }
-                       if (context.profile == Profile.GOBJECT) {
-                               rollback (begin);
-                               return parse_constructor_declaration (attrs);
-                       }
-                       break;
+                       rollback (begin);
+                       return parse_constructor_declaration (attrs);
                case TokenType.DELEGATE:        
                        return parse_delegate_declaration (attrs);      
                case TokenType.DEF:
@@ -3073,8 +3070,8 @@ public class Vala.Genie.Parser : CodeVisitor {
                                                if (readonly) {
                                                        throw new ParseError.SYNTAX (get_error ("set block not allowed for a read only property"));
                                                }
-                                               _construct = (context.profile == Profile.GOBJECT) && accept (TokenType.CONSTRUCT);
-                                       } else if (context.profile == Profile.GOBJECT && accept (TokenType.CONSTRUCT)) {
+                                               _construct = accept (TokenType.CONSTRUCT);
+                                       } else if (accept (TokenType.CONSTRUCT)) {
                                                _construct = true;
                                        } else if (!accept (TokenType.EOL)) {
                                                throw new ParseError.SYNTAX (get_error ("expected get, set, or construct"));
index 358693eba3e063946560766b1d5401fb733b6c5f..f851d68e5cd13cf91734fc5f70e5e680f2804c6d 100644 (file)
@@ -842,7 +842,7 @@ public class Vala.MemberAccess : Expression {
                }
 
                var this_access = inner.symbol_reference is Parameter && inner.symbol_reference.name == "this";
-               var struct_or_array = (inner.value_type is StructValueType && !inner.value_type.nullable) || (CodeContext.get ().profile == Profile.GOBJECT && inner.value_type is ArrayType);
+               var struct_or_array = (inner.value_type is StructValueType && !inner.value_type.nullable) || inner.value_type is ArrayType;
 
                if (instance && struct_or_array && (symbol_reference is Method || lvalue) && ((inner is MemberAccess && inner.symbol_reference is Variable) || inner is ElementAccess) && !this_access) {
                        inner.lvalue = true;
index 0cb8cac041245b00faee2035a6a8a7d78e089cde..5b0ba8a1dec199dd74012c85c85c28ee5d57eff5 100644 (file)
@@ -213,7 +213,7 @@ public class Vala.MethodCall : Expression {
 
                var mtype = call.value_type;
 
-               if (mtype is ObjectType || (context.profile == Profile.GOBJECT && call.symbol_reference == context.analyzer.object_type)) {
+               if (mtype is ObjectType || call.symbol_reference == context.analyzer.object_type) {
                        // constructor chain-up
                        var cm = context.analyzer.find_current_method () as CreationMethod;
                        if (cm == null) {
index 7384746d0e5ec9393b7529425f3861bf53f7df9f..a4121f3aae3abc9b7e9cfd44405825038bdb45fa 100644 (file)
@@ -298,7 +298,7 @@ public class Vala.ObjectCreationExpression : Expression {
                                symbol_reference = st.default_construction_method;
                        }
 
-                       if (context.profile == Profile.GOBJECT && st.is_simple_type () && symbol_reference == null) {
+                       if (st.is_simple_type () && symbol_reference == null) {
                                error = true;
                                Report.error (source_reference, "`%s' does not have a default constructor".printf (st.get_full_name ()));
                                return false;
index 0f7d0e378f2754e9ab9c291cccc66469a48fb4a1..ca0022a175a97322a497f7c696279b176705cb54 100644 (file)
@@ -2138,12 +2138,9 @@ public class Vala.Parser : CodeVisitor {
        
                switch (current ()) {   
                case TokenType.CONSTRUCT:
-                       if (context.profile == Profile.GOBJECT) {
-                               rollback (begin);
-                               parse_constructor_declaration (parent, attrs);
-                               return;
-                       }
-                       break;
+                       rollback (begin);
+                       parse_constructor_declaration (parent, attrs);
+                       return;
                case TokenType.TILDE:
                        rollback (begin);
                        parse_destructor_declaration (parent, attrs);
@@ -2726,8 +2723,8 @@ public class Vala.Parser : CodeVisitor {
                                        bool writable, _construct;
                                        if (accept (TokenType.SET)) {
                                                writable = true;
-                                               _construct = (context.profile == Profile.GOBJECT) && accept (TokenType.CONSTRUCT);
-                                       } else if (context.profile == Profile.GOBJECT && accept (TokenType.CONSTRUCT)) {
+                                               _construct = accept (TokenType.CONSTRUCT);
+                                       } else if (accept (TokenType.CONSTRUCT)) {
                                                _construct = true;
                                                writable = accept (TokenType.SET);
                                        } else {
index d0f938dc4133921b08a180cb028ca3a13728aa57..4bfaf34ee862dad864250c10ec4843a74461c659 100644 (file)
@@ -83,7 +83,7 @@ public class Vala.PointerType : DataType {
                        return base_type.compatible (target_type);
                }
 
-               if (CodeContext.get ().profile == Profile.GOBJECT && target_type.data_type != null && target_type.data_type.is_subtype_of (CodeContext.get ().analyzer.gvalue_type.data_type)) {
+               if (target_type.data_type != null && target_type.data_type.is_subtype_of (CodeContext.get ().analyzer.gvalue_type.data_type)) {
                        // allow implicit conversion to GValue
                        return true;
                }
index 677930fbb76e783bab13c26504f50f90c986ed3f..80249657225e9733dbe8d6768b2c40c75b36c9be 100644 (file)
@@ -21,6 +21,5 @@
  */
 
 public enum Vala.Profile {
-       POSIX,
        GOBJECT
 }
index 3d66b56f3bf7702c8bfaa67b771d2e54084dbe57..8afe17582f9d5b71d4f7f6bf867ef1341015579c 100644 (file)
@@ -201,22 +201,20 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        unichar_type = new IntegerType (unichar_struct);
                }
 
-               if (context.profile == Profile.GOBJECT) {
-                       var glib_ns = root_symbol.scope.lookup ("GLib");
+               var glib_ns = root_symbol.scope.lookup ("GLib");
 
-                       object_type = (Class) glib_ns.scope.lookup ("Object");
-                       type_type = new IntegerType ((Struct) glib_ns.scope.lookup ("Type"));
-                       gvalue_type = new StructValueType ((Struct) glib_ns.scope.lookup ("Value"));
-                       gvariant_type = new ObjectType ((Class) glib_ns.scope.lookup ("Variant"));
+               object_type = (Class) glib_ns.scope.lookup ("Object");
+               type_type = new IntegerType ((Struct) glib_ns.scope.lookup ("Type"));
+               gvalue_type = new StructValueType ((Struct) glib_ns.scope.lookup ("Value"));
+               gvariant_type = new ObjectType ((Class) glib_ns.scope.lookup ("Variant"));
 
-                       glist_type = new ObjectType ((Class) glib_ns.scope.lookup ("List"));
-                       gslist_type = new ObjectType ((Class) glib_ns.scope.lookup ("SList"));
-                       garray_type = new ObjectType ((Class) glib_ns.scope.lookup ("Array"));
-                       gvaluearray_type = new ObjectType ((Class) glib_ns.scope.lookup ("ValueArray"));
+               glist_type = new ObjectType ((Class) glib_ns.scope.lookup ("List"));
+               gslist_type = new ObjectType ((Class) glib_ns.scope.lookup ("SList"));
+               garray_type = new ObjectType ((Class) glib_ns.scope.lookup ("Array"));
+               gvaluearray_type = new ObjectType ((Class) glib_ns.scope.lookup ("ValueArray"));
 
-                       gerror_type = (Class) glib_ns.scope.lookup ("Error");
-                       regex_type = new ObjectType ((Class) root_symbol.scope.lookup ("GLib").scope.lookup ("Regex"));
-               }
+               gerror_type = (Class) glib_ns.scope.lookup ("Error");
+               regex_type = new ObjectType ((Class) root_symbol.scope.lookup ("GLib").scope.lookup ("Regex"));
 
                current_symbol = root_symbol;
                context.root.check (context);
index 2dbcc3de60c8305d887516aca455f21506604635..0c30d3357d32dc52bc3f7e54cbd3c51fd1137b2a 100644 (file)
@@ -79,11 +79,7 @@ public class Vala.ThrowStatement : CodeNode, Statement {
 
                checked = true;
 
-               if (context.profile == Profile.GOBJECT) {
-                       error_expression.target_type = new ErrorType (null, null, source_reference);
-               } else {
-                       error_expression.target_type = context.analyzer.error_type.copy ();
-               }
+               error_expression.target_type = new ErrorType (null, null, source_reference);
                error_expression.target_type.value_owned = true;
 
                if (error_expression != null) {
@@ -98,7 +94,7 @@ public class Vala.ThrowStatement : CodeNode, Statement {
                                return false;
                        }
 
-                       if (context.profile == Profile.GOBJECT && !(error_expression.value_type is ErrorType)) {
+                       if (!(error_expression.value_type is ErrorType)) {
                                Report.error (error_expression.source_reference, "`%s' is not an error type".printf (error_expression.value_type.to_string ()));
                                error = true;
                                return false;
index 22147334aaee0a2c259399c9dbace39c9bd9c28b..4a49f5bac4172ab0cb87dd03e2ac5dbf4ad36516 100644 (file)
@@ -116,7 +116,7 @@ public class Vala.TypeCheck : Expression {
                        return false;
                }
 
-               if (context.profile == Profile.GOBJECT && type_reference.get_type_arguments ().size > 0) {
+               if (type_reference.get_type_arguments ().size > 0) {
                        Report.warning (_data_type.source_reference, "Type argument list has no effect");
                }
 
index 1154016afe63f84bdd8c81f88ee4df78ab306cb0..9b0e02e13f1ce240fcb57190e57651d7e4c82ced 100644 (file)
@@ -82,7 +82,7 @@ public class Vala.TypeofExpression : Expression {
 
                value_type = context.analyzer.type_type;
 
-               if (context.profile == Profile.GOBJECT && type_reference.get_type_arguments ().size > 0) {
+               if (type_reference.get_type_arguments ().size > 0) {
                        Report.warning (_data_type.source_reference, "Type argument list without effect");
                }
 
index cb7d485af780a7030d6632f0dac9e21dfec31147..1276267b4474f1b66fdc8dee94ccd19a9f9a66da 100644 (file)
@@ -164,11 +164,7 @@ namespace Archive {
                public Result open_filename (string filename, size_t _block_size);
                public Result open_memory (void* buff, size_t size);
                public Result open_fd (int fd, size_t block_size);
-#if POSIX
-               public Result open_FILE (Posix.FILE file);
-#else
                public Result open_FILE (GLib.FileStream file);
-#endif
                public Result next_header (out unowned Entry entry);
                public int64 header_position ();
 
@@ -224,11 +220,7 @@ namespace Archive {
                );
                public Result open_fd (int fd);
                public Result open_filename (string filename);
-#if POSIX
-               public Result open_FILE (Posix.FILE file);
-#else
                public Result open_FILE (GLib.FileStream file);
-#endif
                public Result open_memory (void* buffer, size_t buff_size, out size_t used);
 
                [CCode (cname="archive_write_header")]
index 46b4629b17e6f41d8fd5d8d3c420c4b8b575a2a8..b50f57c424b6b8a606b06a2c3c1a94c452e3fd8c 100644 (file)
@@ -83,11 +83,7 @@ namespace Daemon {
 
        public int exec (string dir, out int ret, string prog, ...);
 
-#if POSIX
-       public Posix.pid_t fork ();
-#else
        public GLib.Pid fork ();
-#endif
        public int retval_init ();
        public void retval_done ();
        public int retval_wait (int timeout);
@@ -115,11 +111,7 @@ namespace Daemon {
        public unowned string pid_file_proc_default ();
        public int pid_file_create ();
        public int pid_file_remove ();
-#if POSIX
-       public Posix.pid_t pid_file_is_running ();
-#else
        public GLib.Pid pid_file_is_running ();
-#endif
        public int pid_file_kill (Sig s);
        public int pid_file_kill_wait (Sig s, int m);
 
index 1e7348280169d53452c848071adc1185e1d21ceb..dd2fe5980f684bb1c6a4ded8fe7326e5d1cefd75 100644 (file)
@@ -354,11 +354,7 @@ namespace Xml {
                public Dtd* create_int_subset (string name, string external_id, string system_id);
 
                [CCode (cname = "xmlDocDump", instance_pos = -1)]
-#if POSIX
-               public int dump (Posix.FILE f);
-#else
                public int dump (GLib.FileStream f);
-#endif
 
                [CCode (cname = "xmlDocDumpFormatMemory")]
                public void dump_memory_format (out string mem, out int len = null, bool format = true);
@@ -373,11 +369,7 @@ namespace Xml {
                public void dump_memory_enc (out string mem, out int len = null, string enc = "UTF-8");
 
                [CCode (cname = "xmlDocFormatDump", instance_pos = 1.1)]
-#if POSIX
-               public int dump_format (Posix.FILE f, bool format = true);
-#else
                public int dump_format (GLib.FileStream f, bool format = true);
-#endif
 
                [CCode (cname = "xmlDocGetRootElement")]
                public Node* get_root_element();
@@ -386,11 +378,7 @@ namespace Xml {
                public Node* set_root_element(Node* root);
 
                [CCode (cname = "xmlElemDump", instance_pos = 1.1)]
-#if POSIX
-               public void elem_dump (Posix.FILE f, Node* cur);
-#else
                public void elem_dump (GLib.FileStream f, Node* cur);
-#endif
 
                [CCode (cname = "xmlGetDocCompressMode")]
                public int get_compress_mode ();
@@ -884,11 +872,7 @@ namespace Xml {
                public static string path_to_uri (string path);
 
                [CCode (cname = "xmlPrintURI", instance_pos = -1)]
-#if POSIX
-               public void print (Posix.FILE stream);
-#else
                public void print (GLib.FileStream stream);
-#endif
 
                [CCode (cname = "xmlSaveUri")]
                public string save ();
@@ -1740,28 +1724,16 @@ namespace Html {
                public void dump_memory_format (out string mem, out int len = null, bool format = true);
 
                [CCode (cname = "htmlDocDump", instance_pos = -1)]
-#if POSIX
-               public int dump (Posix.FILE f);
-#else
                public int dump (GLib.FileStream f);
-#endif
 
                [CCode (cname = "htmlSaveFile", instance_pos = -1)]
                public int save_file (string filename);
 
                [CCode (cname = "htmlNodeDumpFile", instance_pos = 1.1)]
-#if POSIX
-               public int node_dump_file (Posix.FILE file, Xml.Node* node);
-#else
                public int node_dump_file (GLib.FileStream file, Xml.Node* node);
-#endif
 
                [CCode (cname = "htmlNodeDumpFileFormat", instance_pos = 1.1)]
-#if POSIX
-               public int node_dump_file_format (Posix.FILE file, string enc = "UTF-8", bool format = true);
-#else
                public int node_dump_file_format (GLib.FileStream file, string enc = "UTF-8", bool format = true);
-#endif
 
                [CCode (cname = "htmlSaveFileEnc", instance_pos = 1.1)]
                public int save_file_enc (string filename, string enc = "UTF-8");
index 2e2966ecc5c91c805259f3140fa6ea65b69b546d..6d56e8dcc078759382ccc331aa5462357b5af26c 100644 (file)
  *  Marco Trevisan (Treviño) <mail@3v1n0.net>
  */
 
-#if POSIX
-[CCode (cname = "bool", cheader_filename = "stdbool.h", default_value = "false")]
-[BooleanType]
-public struct bool {
-       public inline unowned string to_string () {
-               if (this) {
-                       return "true";
-               } else {
-                       return "false";
-               }
-       }
-
-       public static inline bool parse (string str) {
-               if (str == "true") {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-}
-
-[CCode (cname = "char", default_value = "\'\\0\'")]
-[IntegerType (rank = 2, min = 0, max = 127)]
-public struct char {
-       public inline string to_string () {
-               return "%c".printf (this);
-       }
-}
-
-[CCode (cname = "unsigned char", default_value = "\'\\0\'")]
-[IntegerType (rank = 3, min = 0, max = 255)]
-public struct uchar {
-       public inline string to_string () {
-               return "%hhu".printf (this);
-       }
-}
-
-[CCode (cname = "int", default_value = "0")]
-[IntegerType (rank = 6)]
-public struct int {
-       public inline string to_string () {
-               return "%d".printf (this);
-       }
-
-       [CCode (cname = "atoi", cheader_filename = "stdlib.h")]
-       public static int parse (string str);
-}
-
-[CCode (cname = "unsigned int", default_value = "0U")]
-[IntegerType (rank = 7)]
-public struct uint {
-       public inline string to_string () {
-               return "%u".printf (this);
-       }
-}
-
-[CCode (cname = "short", default_value = "0")]
-[IntegerType (rank = 4, min = -32768, max = 32767)]
-public struct short {
-       public inline string to_string () {
-               return "%hi".printf (this);
-       }
-}
-
-[CCode (cname = "unsigned short", default_value = "0U")]
-[IntegerType (rank = 5, min = 0, max = 65535)]
-public struct ushort {
-       public inline string to_string () {
-               return "%hu".printf (this);
-       }
-}
-
-[CCode (cname = "long", default_value = "0L")]
-[IntegerType (rank = 8)]
-public struct long {
-       public inline string to_string () {
-               return "%li".printf (this);
-       }
-
-       [CCode (cname = "atol", cheader_filename = "stdlib.h")]
-       public static long parse (string str);
-}
-
-[CCode (cname = "unsigned long", default_value = "0UL")]
-[IntegerType (rank = 9)]
-public struct ulong {
-       public inline string to_string () {
-               return "%lu".printf (this);
-       }
-}
-
-[CCode (cname = "size_t", cheader_filename = "sys/types.h", default_value = "0UL")]
-[IntegerType (rank = 9)]
-public struct size_t {
-       public inline string to_string () {
-               return "%zu".printf (this);
-       }
-}
-
-[CCode (cname = "ssize_t", cheader_filename = "sys/types.h", default_value = "0L")]
-[IntegerType (rank = 8)]
-public struct ssize_t {
-       public inline string to_string () {
-               return "%zi".printf (this);
-       }
-}
-
-[CCode (cname = "int8_t", cheader_filename = "stdint.h", default_value = "0")]
-[IntegerType (rank = 1, min = -128, max = 127)]
-public struct int8 {
-       [CCode (cname = "PRIi8", cheader_filename = "inttypes.h")]
-       public const string FORMAT;
-
-       public inline string to_string () {
-               return ("%" + FORMAT).printf (this);
-       }
-}
-
-[CCode (cname = "uint8_t", cheader_filename = "stdint.h", default_value = "0U")]
-[IntegerType (rank = 3, min = 0, max = 255)]
-public struct uint8 {
-       [CCode (cname = "PRIu8", cheader_filename = "inttypes.h")]
-       public const string FORMAT;
-
-       public inline string to_string () {
-               return ("%" + FORMAT).printf (this);
-       }
-}
-
-[CCode (cname = "int16_t", cheader_filename = "stdint.h", default_value = "0")]
-[IntegerType (rank = 4, min = -32768, max = 32767)]
-public struct int16 {
-       [CCode (cname = "PRIi16", cheader_filename = "inttypes.h")]
-       public const string FORMAT;
-
-       public inline string to_string () {
-               return ("%" + FORMAT).printf (this);
-       }
-}
-
-[CCode (cname = "uint16_t", cheader_filename = "stdint.h", default_value = "0U")]
-[IntegerType (rank = 5, min = 0, max = 65535)]
-public struct uint16 {
-       [CCode (cname = "PRIu16", cheader_filename = "inttypes.h")]
-       public const string FORMAT;
-
-       public inline string to_string () {
-               return ("%" + FORMAT).printf (this);
-       }
-}
-
-[CCode (cname = "int32_t", cheader_filename = "stdint.h", default_value = "0")]
-[IntegerType (rank = 6)]
-public struct int32 {
-       [CCode (cname = "PRIi32", cheader_filename = "inttypes.h")]
-       public const string FORMAT;
-
-       public inline string to_string () {
-               return ("%" + FORMAT).printf (this);
-       }
-}
-
-[CCode (cname = "uint32_t", cheader_filename = "stdint.h", default_value = "0U")]
-[IntegerType (rank = 7)]
-public struct uint32 {
-       [CCode (cname = "PRIu32", cheader_filename = "inttypes.h")]
-       public const string FORMAT;
-
-       public inline string to_string () {
-               return ("%" + FORMAT).printf (this);
-       }
-}
-
-[CCode (cname = "int64_t", cheader_filename = "stdint.h", default_value = "0LL")]
-[IntegerType (rank = 10)]
-public struct int64 {
-       [CCode (cname = "PRIi64", cheader_filename = "inttypes.h")]
-       public const string FORMAT;
-
-       public inline string to_string () {
-               return ("%" + FORMAT).printf (this);
-       }
-
-       [CCode (cname = "strtoll", cheader_filename = "stdlib.h")]
-       public static int64 parse (string str, out unowned string? end = null, int base = 10);
-}
-
-[CCode (cname = "uint64_t", cheader_filename = "stdint.h", default_value = "0ULL")]
-[IntegerType (rank = 11)]
-public struct uint64 {
-       [CCode (cname = "PRIu64", cheader_filename = "inttypes.h")]
-       public const string FORMAT;
-
-       public inline string to_string () {
-               return ("%" + FORMAT).printf (this);
-       }
-
-       [CCode (cname = "strtoull", cheader_filename = "stdlib.h")]
-       public static uint64 parse (string str, out unowned string? end = null, int base = 10);
-}
-
-[CCode (cname = "float", default_value = "0.0F")]
-[FloatingType (rank = 1)]
-public struct float {
-       public inline string to_string () {
-               return "%.8g".printf (this);
-       }
-}
-
-[CCode (cname = "double", default_value = "0.0")]
-[FloatingType (rank = 2)]
-public struct double {
-       public inline string to_string () {
-               return "%.17g".printf (this);
-       }
-
-       [CCode (cname = "strtod", cheader_filename = "stdlib.h")]
-       public static double parse (string str, out unowned string? end = null);
-}
-
-[CCode (cheader_filename = "time.h")]
-[IntegerType (rank = 8)]
-public struct time_t {
-       [CCode (cname = "time")]
-       public time_t ();
-}
-
-[Compact]
-[Immutable]
-[CCode (cname = "char", const_cname = "const char", copy_function = "strdup", free_function = "free", cheader_filename = "stdlib.h,string.h")]
-public class string {
-       [Deprecated (replacement = "int.parse")]
-       [CCode (cname="atoi")]
-       public int to_int();
-       [Deprecated (replacement = "long.parse")]
-       [CCode (cname="atol")]
-       public long to_long();
-       [Deprecated (replacement = "int64.parse")]
-       [CCode (cname="atoll")]
-       public int64 to_int64();
-       [Deprecated (replacement = "string.length")]
-       [CCode (cname="strlen")]
-       public int len();
-
-       [PrintfFormat]
-       public string printf (...);
-
-       public inline unowned string to_string () {
-               return this;
-       }
-
-       public int length {
-               [CCode (cname = "strlen")]
-               get;
-       }
-}
-
-[CCode (cname="printf", cheader_filename = "stdio.h")]
-[PrintfFormat]
-public void print (string format,...);
-
-#endif
-
 [CCode (cprefix = "", lower_case_cprefix = "")]
 namespace Posix {
        [CCode (cheader_filename = "assert.h")]