Navigation Menu

Skip to content

Commit

Permalink
Don't use variable length array declaration
Browse files Browse the repository at this point in the history
It seems that MariaDB 10.0 dislikes the feature.
  • Loading branch information
kou committed Mar 24, 2015
1 parent 6ebabe3 commit e135b47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ha_mroonga.cpp
Expand Up @@ -55,9 +55,6 @@
#ifdef WIN32
# include <math.h>
# include <direct.h>
# define MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(type, variable_name, variable_size) \
type *variable_name = (type *)_malloca(sizeof(type) * (variable_size))
# define MRN_FREE_VARIABLE_LENGTH_ARRAYS(variable_name) _freea(variable_name)
# define MRN_TABLE_SHARE_LOCK_SHARE_PROC "?key_TABLE_SHARE_LOCK_share@@3IA"
# define MRN_TABLE_SHARE_LOCK_HA_DATA_PROC "?key_TABLE_SHARE_LOCK_ha_data@@3IA"
# ifdef _WIN64
Expand All @@ -70,11 +67,14 @@
#else
# include <dirent.h>
# include <unistd.h>
# define MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(type, variable_name, variable_size) \
type variable_name[variable_size]
# define MRN_FREE_VARIABLE_LENGTH_ARRAYS(variable_name)
#endif

#define MRN_ALLOCATE_VARIABLE_LENGTH_ARRAYS(type, variable_name, variable_size) \
type *variable_name = \
(type *)mrn_my_malloc(sizeof(type) * (variable_size), MYF(MY_WME))
#define MRN_FREE_VARIABLE_LENGTH_ARRAYS(variable_name) \
my_free(variable_name)

#include "mrn_err.h"
#include "mrn_table.hpp"
#include "ha_mroonga.hpp"
Expand Down

0 comments on commit e135b47

Please sign in to comment.