From 153eb42502df281d23fd08488567921b08cae09e Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Tue, 23 Apr 2019 14:55:13 -0400 Subject: [PATCH] Move the visibility pragmas below the includes. This fixes some possible issues with the linker and the standard C runtime. --- profiles/mojoshader_profile_arb1.c | 6 +++--- profiles/mojoshader_profile_bytecode.c | 6 +++--- profiles/mojoshader_profile_common.c | 6 +++--- profiles/mojoshader_profile_d3d.c | 6 +++--- profiles/mojoshader_profile_glsl.c | 6 +++--- profiles/mojoshader_profile_metal.c | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/profiles/mojoshader_profile_arb1.c b/profiles/mojoshader_profile_arb1.c index 2e5bf900..2f374e58 100644 --- a/profiles/mojoshader_profile_arb1.c +++ b/profiles/mojoshader_profile_arb1.c @@ -7,11 +7,11 @@ * This file written by Ryan C. Gordon. */ -#pragma GCC visibility push(hidden) - #define __MOJOSHADER_INTERNAL__ 1 #include "mojoshader_profile.h" +#pragma GCC visibility push(hidden) + #if SUPPORT_PROFILE_ARB1 static inline const char *get_ARB1_register_string(Context *ctx, @@ -2249,4 +2249,4 @@ void emit_ARB1_TEXLD(Context *ctx) #endif // SUPPORT_PROFILE_ARB1 -#pragma GCC visibility pop \ No newline at end of file +#pragma GCC visibility pop diff --git a/profiles/mojoshader_profile_bytecode.c b/profiles/mojoshader_profile_bytecode.c index 072e2ddc..5b867e5c 100644 --- a/profiles/mojoshader_profile_bytecode.c +++ b/profiles/mojoshader_profile_bytecode.c @@ -7,11 +7,11 @@ * This file written by Ryan C. Gordon. */ -#pragma GCC visibility push(hidden) - #define __MOJOSHADER_INTERNAL__ 1 #include "mojoshader_profile.h" +#pragma GCC visibility push(hidden) + #if SUPPORT_PROFILE_BYTECODE void emit_BYTECODE_start(Context *ctx, const char *profilestr) @@ -149,4 +149,4 @@ EMIT_BYTECODE_OPCODE_FUNC(TEXLD) #endif // SUPPORT_PROFILE_BYTECODE -#pragma GCC visibility pop \ No newline at end of file +#pragma GCC visibility pop diff --git a/profiles/mojoshader_profile_common.c b/profiles/mojoshader_profile_common.c index 8569a7ce..ff7d014e 100644 --- a/profiles/mojoshader_profile_common.c +++ b/profiles/mojoshader_profile_common.c @@ -7,11 +7,11 @@ * This file written by Ryan C. Gordon. */ -#pragma GCC visibility push(hidden) - #define __MOJOSHADER_INTERNAL__ 1 #include "mojoshader_profile.h" +#pragma GCC visibility push(hidden) + // Common Utilities void out_of_memory(Context *ctx) @@ -501,4 +501,4 @@ const char *get_D3D_varname(Context *ctx, RegisterType rt, int regnum) return StrDup(ctx, buf); } // get_D3D_varname -#pragma GCC visibility pop \ No newline at end of file +#pragma GCC visibility pop diff --git a/profiles/mojoshader_profile_d3d.c b/profiles/mojoshader_profile_d3d.c index 6327dc59..a2d1842e 100644 --- a/profiles/mojoshader_profile_d3d.c +++ b/profiles/mojoshader_profile_d3d.c @@ -7,11 +7,11 @@ * This file written by Ryan C. Gordon. */ -#pragma GCC visibility push(hidden) - #define __MOJOSHADER_INTERNAL__ 1 #include "mojoshader_profile.h" +#pragma GCC visibility push(hidden) + #if SUPPORT_PROFILE_D3D const char *make_D3D_srcarg_string_in_buf(Context *ctx, @@ -683,4 +683,4 @@ void emit_D3D_SINCOS(Context *ctx) #endif // SUPPORT_PROFILE_D3D -#pragma GCC visibility pop \ No newline at end of file +#pragma GCC visibility pop diff --git a/profiles/mojoshader_profile_glsl.c b/profiles/mojoshader_profile_glsl.c index 7760e147..910c217a 100644 --- a/profiles/mojoshader_profile_glsl.c +++ b/profiles/mojoshader_profile_glsl.c @@ -7,11 +7,11 @@ * This file written by Ryan C. Gordon. */ -#pragma GCC visibility push(hidden) - #define __MOJOSHADER_INTERNAL__ 1 #include "mojoshader_profile.h" +#pragma GCC visibility push(hidden) + #if SUPPORT_PROFILE_GLSL #define EMIT_GLSL_OPCODE_UNIMPLEMENTED_FUNC(op) \ @@ -2304,4 +2304,4 @@ void emit_GLSL_RESERVED(Context *ctx) #endif // SUPPORT_PROFILE_GLSL -#pragma GCC visibility pop \ No newline at end of file +#pragma GCC visibility pop diff --git a/profiles/mojoshader_profile_metal.c b/profiles/mojoshader_profile_metal.c index 6106f3af..26e4748e 100644 --- a/profiles/mojoshader_profile_metal.c +++ b/profiles/mojoshader_profile_metal.c @@ -7,11 +7,11 @@ * This file written by Ryan C. Gordon. */ -#pragma GCC visibility push(hidden) - #define __MOJOSHADER_INTERNAL__ 1 #include "mojoshader_profile.h" +#pragma GCC visibility push(hidden) + // !!! FIXME: A lot of this is cut-and-paste from the GLSL version. #if SUPPORT_PROFILE_METAL @@ -2302,4 +2302,4 @@ void emit_METAL_RESERVED(Context *ctx) #endif // SUPPORT_PROFILE_METAL -#pragma GCC visibility pop \ No newline at end of file +#pragma GCC visibility pop