Skip to content

Instantly share code, notes, and snippets.

@TooTallNate
Created September 30, 2012 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TooTallNate/0e8be25d80a13b9033ce to your computer and use it in GitHub Desktop.
Save TooTallNate/0e8be25d80a13b9033ce to your computer and use it in GitHub Desktop.
C:\Users\Nathan\Desktop\repos\node-lame>git diff deps\lame\libmp3lame
diff --git a/deps/lame/libmp3lame/psymodel.c b/deps/lame/libmp3lame/psymodel.c
index d4c62b7..673fcf4 100644
--- a/deps/lame/libmp3lame/psymodel.c
+++ b/deps/lame/libmp3lame/psymodel.c
@@ -268,7 +268,17 @@ static const FLOAT tab[] = {
};
static const int tab_mask_add_delta[] = { 2, 2, 2, 1, 1, 1, 0, 0, -1 };
-#define STATIC_ASSERT_EQUAL_DIMENSION(A,B) {extern char static_assert_##A[dimension_of(A) == dimension_of(B) ? 1 : -1];(void) static_assert
+#define __STATIC_ASSERT0(expr, where) \
+ enum { __static_assert_ ## where = 1 / !!(expr) }
+
+#define __STATIC_ASSERT1(expr, where) \
+ __STATIC_ASSERT0(expr, where)
+
+#define STATIC_ASSERT(expr) \
+ __STATIC_ASSERT1(expr, __LINE__)
+
+#define STATIC_ASSERT_EQUAL_DIMENSION(A,B) {STATIC_ASSERT(dimension_of(A) == dimension_of(B));}
+
inline static int
mask_add_delta(int i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment