Subversion Repositories Kolibri OS

Rev

Rev 6574 | Rev 8155 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6574 Rev 7520
Line 84... Line 84...
84
{
84
{
85
    tcc_error("inline asm() not supported");
85
    tcc_error("inline asm() not supported");
86
}
86
}
87
#endif
87
#endif
Line -... Line 88...
-
 
88
 
-
 
89
 
88
 
90
 
89
/********************************************************/
91
/********************************************************/
90
#ifdef _WIN32
92
#ifdef _WIN32
91
static char *normalize_slashes(char *path)
93
static char *normalize_slashes(char *path)
92
{
94
{
Line 135... Line 137...
135
    if (DLL_PROCESS_ATTACH == dwReason)
137
    if (DLL_PROCESS_ATTACH == dwReason)
136
        tcc_module = hDll;
138
        tcc_module = hDll;
137
    return TRUE;
139
    return TRUE;
138
}
140
}
139
#endif
141
#endif
-
 
142
#else // _WIN32
-
 
143
#ifdef TCC_TARGET_MEOS
-
 
144
/* on Kolibri host, we suppose the lib and includes are at the location of 'tcc' /lib, /include */
-
 
145
static void tcc_set_lib_path_kos(TCCState *s)
-
 
146
{
-
 
147
	char** argv0 = (char**)0x20; // path in kolibri header
-
 
148
    char path[1024], *p;
-
 
149
	strncpy(path, *argv0, sizeof path);
-
 
150
	p = tcc_basename(path);
-
 
151
    if (p > path) p--;
-
 
152
    *p = 0;
-
 
153
    tcc_set_lib_path(s, path);
-
 
154
}
-
 
155
#endif
140
#endif
156
#endif
Line 141... Line 157...
141
 
157
 
142
/********************************************************/
158
/********************************************************/
143
/* copy a string and truncate it. */
159
/* copy a string and truncate it. */
Line 1074... Line 1090...
1074
        return NULL;
1090
        return NULL;
1075
    tcc_state = s;
1091
    tcc_state = s;
1076
#ifdef _WIN32
1092
#ifdef _WIN32
1077
    tcc_set_lib_path_w32(s);
1093
    tcc_set_lib_path_w32(s);
1078
#else
1094
#else
-
 
1095
#ifdef TCC_TARGET_MEOS
-
 
1096
    tcc_set_lib_path_kos(s);
-
 
1097
#else
1079
    tcc_set_lib_path(s, CONFIG_TCCDIR);
1098
    tcc_set_lib_path(s, CONFIG_TCCDIR);
1080
#endif
1099
#endif
-
 
1100
#endif
1081
    s->output_type = 0;
1101
    s->output_type = 0;
1082
    preprocess_new();
1102
    preprocess_new();
1083
    s->include_stack_ptr = s->include_stack;
1103
    s->include_stack_ptr = s->include_stack;
Line 1084... Line 1104...
1084
 
1104
 
Line 1451... Line 1471...
1451
    char buf[1024];
1471
    char buf[1024];
1452
    int i;
1472
    int i;
Line 1453... Line 1473...
1453
 
1473
 
1454
    for(i = 0; i < nb_paths; i++) {
1474
    for(i = 0; i < nb_paths; i++) {
1455
        snprintf(buf, sizeof(buf), fmt, paths[i], filename);
1475
        snprintf(buf, sizeof(buf), fmt, paths[i], filename);
1456
//printf("added lib [%s]\n", buf);
1476
//printf("tcc_add_library_internal::added lib [%s]\n", buf);
1457
        if (tcc_add_file_internal(s, buf, flags, TCC_FILETYPE_BINARY) == 0)
1477
        if (tcc_add_file_internal(s, buf, flags, TCC_FILETYPE_BINARY) == 0)
1458
            return 0;
1478
            return 0;
1459
    }
1479
    }
1460
    return -1;
1480
    return -1;