diff options
| author | Zuhaitz <zuhaitz.zechhub@gmail.com> | 2026-01-15 18:40:07 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-15 18:40:07 +0000 |
| commit | 301d9582884ec7d180791e5c9c6ec649dc01ff68 (patch) | |
| tree | 056039f66098e1a8ef4b6544fb09d5a77f708a90 /src/codegen | |
| parent | f59e40a172f555c536cfc7af57536bb919d01e92 (diff) | |
| parent | a571fe7931d54c660f0d1b1fdcbc1d858fa6c502 (diff) | |
Merge pull request #57 from vitalyster/ci-mac
chore: update CI to run on macOS and Ubuntu
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/codegen.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/codegen/codegen.c b/src/codegen/codegen.c index 91f5bb5..86295e4 100644 --- a/src/codegen/codegen.c +++ b/src/codegen/codegen.c @@ -10,6 +10,14 @@ #include "ast.h" #include "zprep_plugin.h" +#ifdef __APPLE__ +#define SEGMENT_NAME_PREFIX "__TEXT," +#define SEGMENT_NAME_SUFFIX ",regular,pure_instructions" +#else +#define SEGMENT_NAME_PREFIX "" +#define SEGMENT_NAME_SUFFIX "" +#endif + // static function for internal use. static char *g_current_func_ret_type = NULL; static void codegen_match_internal(ParserContext *ctx, ASTNode *node, FILE *out, int use_result) @@ -1367,7 +1375,7 @@ void codegen_node_single(ParserContext *ctx, ASTNode *node, FILE *out) { fprintf(out, ", "); } - fprintf(out, "section(\"%s\")", node->func.section); + fprintf(out, "section(\"%s%s%s\")", SEGMENT_NAME_PREFIX, node->func.section, SEGMENT_NAME_SUFFIX); } #undef EMIT_ATTR fprintf(out, ")) "); |
