+static ir_entity *underscore_compilerlib_entity_creator(ident *id, ir_type *mt)
+{
+ ir_entity *entity = new_entity(get_glob_type(), id, mt);
+ ident *ldname = id_mangle3("_", id, "");
+
+ set_entity_visibility(entity, ir_visibility_external);
+ set_entity_ld_ident(entity, ldname);
+
+ return entity;
+}
+
+bool firm_is_unixish_os(const machine_triple_t *machine)
+{
+ const char *os = machine->operating_system;
+ return strstr(os, "linux") != NULL || strstr(os, "bsd") != NULL
+ || strstart(os, "solaris");
+}
+
+bool firm_is_darwin_os(const machine_triple_t *machine)
+{
+ const char *os = machine->operating_system;
+ return strstart(os, "darwin");
+}
+
+bool firm_is_windows_os(const machine_triple_t *machine)
+{
+ const char *os = machine->operating_system;
+ return strstart(os, "mingw") || streq(os, "win32");
+}
+