[Groonga-commit] pgroonga/pgroonga at 39ac167 [master] Split macros for compatibility

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Jan 23 22:29:12 JST 2016


Kouhei Sutou	2016-01-23 22:29:12 +0900 (Sat, 23 Jan 2016)

  New Revision: 39ac16766f63aef0a0818f2bbf03debd4ea922b0
  https://github.com/pgroonga/pgroonga/commit/39ac16766f63aef0a0818f2bbf03debd4ea922b0

  Message:
    Split macros for compatibility

  Added files:
    src/pgrn_compatible.h
  Modified files:
    src/pgroonga.c

  Added: src/pgrn_compatible.h (+118 -0) 100644
===================================================================
--- /dev/null
+++ src/pgrn_compatible.h    2016-01-23 22:29:12 +0900 (b983b5f)
@@ -0,0 +1,118 @@
+#pragma once
+
+#ifdef GP_VERSION
+#	define PGRN_IS_GREENPLUM
+#endif
+
+#ifndef PGRN_IS_GREENPLUM
+#	define PGRN_SUPPORT_SCORE
+#	define PGRN_SUPPORT_OPTIONS
+#	define PGRN_SUPPORT_ENUM_VARIABLE
+#	define PGRN_SUPPORT_RECHECK_PER_SCAN
+#	define PGRN_SUPPORT_INDEX_ONLY_SCAN
+#	define PGRN_SUPPORT_BITMAP_INDEX
+#endif
+
+#ifndef ERRCODE_SYSTEM_ERROR
+#	define ERRCODE_SYSTEM_ERROR ERRCODE_IO_ERROR
+#endif
+
+#ifdef PGRN_IS_GREENPLUM
+#	define PGrnDefineCustomIntVariable(name,			\
+									   shortDesc,		\
+									   longDesc,		\
+									   valueAddr,		\
+									   bootValue,		\
+									   minValue,		\
+									   maxValue,		\
+									   context,			\
+									   flags,			\
+									   checkHook,		\
+									   assignHook,		\
+									   showHook)		\
+	DefineCustomIntVariable(name,						\
+							shortDesc,					\
+							longDesc,					\
+							valueAddr,					\
+							minValue,					\
+							maxValue,					\
+							context,					\
+							assignHook,					\
+							showHook)
+#	define PGrnDefineCustomStringVariable(name,			\
+										  shortDesc,	\
+										  longDesc,		\
+										  valueAddr,	\
+										  bootValue,	\
+										  context,		\
+										  flags,		\
+										  checkHook,	\
+										  assignHook,	\
+										  showHook)		\
+	DefineCustomStringVariable(name,					\
+							   shortDesc,				\
+							   longDesc,				\
+							   valueAddr,				\
+							   context,					\
+							   assignHook,				\
+							   showHook)
+#else
+#	define PGrnDefineCustomIntVariable(name,			\
+									   shortDesc,		\
+									   longDesc,		\
+									   valueAddr,		\
+									   bootValue,		\
+									   minValue,		\
+									   maxValue,		\
+									   context,			\
+									   flags,			\
+									   checkHook,		\
+									   assignHook,		\
+									   showHook)		\
+	DefineCustomIntVariable(name,						\
+							shortDesc,					\
+							longDesc,					\
+							valueAddr,					\
+							bootValue,					\
+							minValue,					\
+							maxValue,					\
+							context,					\
+							flags,						\
+							checkHook,					\
+							assignHook,					\
+							showHook)
+#	define PGrnDefineCustomStringVariable(name,			\
+										  shortDesc,	\
+										  longDesc,		\
+										  valueAddr,	\
+										  bootValue,	\
+										  context,		\
+										  flags,		\
+										  checkHook,	\
+										  assignHook,	\
+										  showHook)		\
+	DefineCustomStringVariable(name,					\
+							   shortDesc,				\
+							   longDesc,				\
+							   valueAddr,				\
+							   bootValue,				\
+							   context,					\
+							   flags,					\
+							   checkHook,				\
+							   assignHook,				\
+							   showHook)
+#endif
+
+#ifdef PGRN_IS_GREENPLUM
+#	define IndexBuildHeapScan(heapRelation,		\
+							  indexRelation,	\
+							  indexInfo,		\
+							  allow_sync,		\
+							  callback,			\
+							  callbackState)	\
+	IndexBuildScan(heapRelation,				\
+				   indexRelation,				\
+				   indexInfo,					\
+				   callback,					\
+				   callbackState)
+#endif

  Modified: src/pgroonga.c (+1 -116)
===================================================================
--- src/pgroonga.c    2016-01-23 22:28:09 +0900 (2c862a5)
+++ src/pgroonga.c    2016-01-23 22:29:12 +0900 (e478742)
@@ -1,121 +1,6 @@
 #include "pgroonga.h"
 
-#ifdef GP_VERSION
-#	define PGRN_IS_GREENPLUM
-#endif
-
-#ifndef PGRN_IS_GREENPLUM
-#	define PGRN_SUPPORT_SCORE
-#	define PGRN_SUPPORT_OPTIONS
-#	define PGRN_SUPPORT_ENUM_VARIABLE
-#	define PGRN_SUPPORT_RECHECK_PER_SCAN
-#	define PGRN_SUPPORT_INDEX_ONLY_SCAN
-#	define PGRN_SUPPORT_BITMAP_INDEX
-#endif
-
-#ifndef ERRCODE_SYSTEM_ERROR
-#	define ERRCODE_SYSTEM_ERROR ERRCODE_IO_ERROR
-#endif
-
-#ifdef PGRN_IS_GREENPLUM
-#	define PGrnDefineCustomIntVariable(name,			\
-									   shortDesc,		\
-									   longDesc,		\
-									   valueAddr,		\
-									   bootValue,		\
-									   minValue,		\
-									   maxValue,		\
-									   context,			\
-									   flags,			\
-									   checkHook,		\
-									   assignHook,		\
-									   showHook)		\
-	DefineCustomIntVariable(name,						\
-							shortDesc,					\
-							longDesc,					\
-							valueAddr,					\
-							minValue,					\
-							maxValue,					\
-							context,					\
-							assignHook,					\
-							showHook)
-#	define PGrnDefineCustomStringVariable(name,			\
-										  shortDesc,	\
-										  longDesc,		\
-										  valueAddr,	\
-										  bootValue,	\
-										  context,		\
-										  flags,		\
-										  checkHook,	\
-										  assignHook,	\
-										  showHook)		\
-	DefineCustomStringVariable(name,					\
-							   shortDesc,				\
-							   longDesc,				\
-							   valueAddr,				\
-							   context,					\
-							   assignHook,				\
-							   showHook)
-#else
-#	define PGrnDefineCustomIntVariable(name,			\
-									   shortDesc,		\
-									   longDesc,		\
-									   valueAddr,		\
-									   bootValue,		\
-									   minValue,		\
-									   maxValue,		\
-									   context,			\
-									   flags,			\
-									   checkHook,		\
-									   assignHook,		\
-									   showHook)		\
-	DefineCustomIntVariable(name,						\
-							shortDesc,					\
-							longDesc,					\
-							valueAddr,					\
-							bootValue,					\
-							minValue,					\
-							maxValue,					\
-							context,					\
-							flags,						\
-							checkHook,					\
-							assignHook,					\
-							showHook)
-#	define PGrnDefineCustomStringVariable(name,			\
-										  shortDesc,	\
-										  longDesc,		\
-										  valueAddr,	\
-										  bootValue,	\
-										  context,		\
-										  flags,		\
-										  checkHook,	\
-										  assignHook,	\
-										  showHook)		\
-	DefineCustomStringVariable(name,					\
-							   shortDesc,				\
-							   longDesc,				\
-							   valueAddr,				\
-							   bootValue,				\
-							   context,					\
-							   flags,					\
-							   checkHook,				\
-							   assignHook,				\
-							   showHook)
-#endif
-
-#ifdef PGRN_IS_GREENPLUM
-#	define IndexBuildHeapScan(heapRelation,		\
-							  indexRelation,	\
-							  indexInfo,		\
-							  allow_sync,		\
-							  callback,			\
-							  callbackState)	\
-	IndexBuildScan(heapRelation,				\
-				   indexRelation,				\
-				   indexInfo,					\
-				   callback,					\
-				   callbackState)
-#endif
+#include "pgrn_compatible.h"
 #include "pgrn_value.h"
 
 #include <access/relscan.h>
-------------- next part --------------
HTML����������������������������...
Download 



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