Skip to content

Commit

Permalink
Add missing ifdef
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Sep 17, 2024
1 parent dde9e63 commit d31f5eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion tccmacho.c
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,7 @@ static uint32_t macho_swap32(uint32_t x)
// dlopen() just once
char* xcode_select_sdkroot;
bool xcode_select_loaded = false;

#ifdef TCC_TARGET_MACHO
ST_FUNC char* tcc_search_darwin_framework(TCCState* s, const char* include_name) {
// "<Security/Security.h>"
// ^
Expand All @@ -2296,6 +2296,7 @@ ST_FUNC char* tcc_search_darwin_framework(TCCState* s, const char* include_name)

return 0;
}
#endif

ST_FUNC void tcc_add_macos_framework_path(TCCState* s, const char* framework_name, const char* base_path) {
char path_buffer[2048];
Expand Down
15 changes: 9 additions & 6 deletions tccpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,10 @@ search_cached_include(TCCState *s1, const char *filename, int add);
static int parse_include(TCCState *s1, int do_next, int test)
{
int c, i;
char name[1024], buf[1024], *darwin_framework_search_path, *p;
char name[1024], buf[1024], *p;
#ifdef TCC_TARGET_MACHO
char *darwin_framework_search_path;
#endif
CachedInclude *e;

c = skip_spaces();
Expand Down Expand Up @@ -1400,10 +1403,8 @@ static int parse_include(TCCState *s1, int do_next, int test)
p = s1->include_paths[j];
else if (k < s1->nb_sysinclude_paths)
p = s1->sysinclude_paths[k];
else if (test)
return 0;
#ifdef TCC_TARGET_MACHO
else if (s1->nb_framework_names > 0 && (darwin_framework_search_path = tcc_search_darwin_framework(s1, (const char*)name))) {
#ifdef TCC_TARGET_MACHO
else if (s1->nb_framework_names > 0 && (darwin_framework_search_path = tcc_search_darwin_framework(s1, name))) {
pstrcpy(buf, sizeof buf, darwin_framework_search_path);
pstrcat(buf, sizeof buf, tcc_basename(name));
if (tcc_open(s1, buf) >= 0) {
Expand All @@ -1412,7 +1413,9 @@ static int parse_include(TCCState *s1, int do_next, int test)
tcc_error("include file '%s' not found", name);
}
}
#endif
#endif
else if (test)
return 0;
else
tcc_error("include file '%s' not found", name);
pstrcpy(buf, sizeof buf, p);
Expand Down

0 comments on commit d31f5eb

Please sign in to comment.