Navigation Menu

Skip to content

Commit

Permalink
win32: extract the arguments of DBG_RETURN
Browse files Browse the repository at this point in the history
VC++ compiler can't process the macro which contains #ifdef statement as arguments

Example:
DBG_RETURN(
#ifdef ...
#else
#endif
);
  • Loading branch information
kenhys committed Oct 4, 2012
1 parent 7d39b30 commit b16a844
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions ha_mroonga.cpp
Expand Up @@ -12893,19 +12893,29 @@ bool ha_mroonga::check_written_by_row_based_binlog()
{
MRN_DBUG_ENTER_METHOD();
THD *thd = ha_thd();
DBUG_RETURN(
int current_stmt_binlog_row;
#ifdef _WIN32
unsigned __int64 option_bits;
#else
uint64 option_bits;
#endif

#ifdef MRN_ROW_BASED_CHECK_IS_METHOD
thd->is_current_stmt_binlog_format_row() &&
current_stmt_binlog_row = thd->is_current_stmt_binlog_format_row();
#else
thd->current_stmt_binlog_row_based &&
current_stmt_binlog_row = thd->current_stmt_binlog_row_based;
#endif
table->s->tmp_table == NO_TMP_TABLE &&
binlog_filter->db_ok(table->s->db.str) &&
#ifdef MRN_OPTION_BITS_IS_UNDER_VARIABLES
(thd->variables.option_bits & OPTION_BIN_LOG) &&
option_bits = thd->variables.option_bits & OPTION_BIN_LOG;
#else
(thd->options & OPTION_BIN_LOG) &&
option_bits = thd->options & OPTION_BIN_LOG;
#endif

DBUG_RETURN(
current_stmt_binlog_row &&
table->s->tmp_table == NO_TMP_TABLE &&
binlog_filter->db_ok(table->s->db.str) &&
option_bits &&
mysql_bin_log.is_open()
);
}
Expand Down

0 comments on commit b16a844

Please sign in to comment.