[Groonga-mysql-commit] mroonga/mroonga [master] win32: extract the arguments of DBG_RETURN

Back to archive index

HAYASHI Kentaro null+****@clear*****
Thu Oct 4 15:23:02 JST 2012


HAYASHI Kentaro	2012-10-04 15:23:02 +0900 (Thu, 04 Oct 2012)

  New Revision: b16a844b99d2811a499f45dd2303be422e47a95a
  https://github.com/mroonga/mroonga/commit/b16a844b99d2811a499f45dd2303be422e47a95a

  Log:
    win32: extract the arguments of DBG_RETURN
    
    VC++ compiler can't process the macro which contains #ifdef statement as arguments
    
    Example:
    DBG_RETURN(
    #ifdef ...
    #else
    #endif
    );

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+17 -7)
===================================================================
--- ha_mroonga.cpp    2012-10-04 13:48:22 +0900 (d445bf1)
+++ ha_mroonga.cpp    2012-10-04 15:23:02 +0900 (e12bc1c)
@@ -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()
   );
 }
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index