Skip to content

Commit

Permalink
Replace SIZEOF_CHARP by ma_assert macro (windows fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
9EOR9 committed Jul 10, 2016
1 parent f0601e0 commit 6470533
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions include/ma_global.h
Expand Up @@ -21,6 +21,9 @@
#ifndef _global_h
#define _global_h

#define MA_ASSERT_CONCAT_(a, b) a##b
#define MA_ASSERT_CONCAT(a, b) MA_ASSERT_CONCAT_(a, b)
#define ma_assert(e) enum { MA_ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(e)) }

#ifdef _WIN32
#include <ma_config_win.h>
Expand Down
4 changes: 1 addition & 3 deletions libmariadb/ma_context.c
Expand Up @@ -125,9 +125,7 @@ my_context_yield(struct my_context *c)
int
my_context_init(struct my_context *c, size_t stack_size)
{
#if SIZEOF_CHARP > SIZEOF_INT*2
#error Error: Unable to store pointer in 2 ints on this architecture
#endif
ma_assert(sizeof(char *) <= SIZEOF_INT * 2);
memset(c, 0, sizeof(*c));
if (!(c->stack= malloc(stack_size)))
return -1; /* Out of memory */
Expand Down

0 comments on commit 6470533

Please sign in to comment.