MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Martin Zaun Date:November 13 2009 7:00pm
Subject:bzr commit into mysql-5.1-telco-6.3-ndbjtie branch (martin.zaun:3113)
View as plain text  
#At file:///Users/mz/mysql/ndb-6.3-ndbjtie-automake/ based on revid:martin.zaun@stripped

 3113 Martin Zaun	2009-11-13
      ndbjtie - added ndbapi wrapper as workround to Solaris Studio CC compile issues.

    added:
      storage/ndb/ndbjtie/src/ndbapi_wrapper.hpp
    modified:
      storage/ndb/ndbjtie/src/Makefile.am
      storage/ndb/ndbjtie/src/ndbapi_jtie.hpp
=== modified file 'storage/ndb/ndbjtie/src/Makefile.am'
--- a/storage/ndb/ndbjtie/src/Makefile.am	2009-11-09 16:53:03 +0000
+++ b/storage/ndb/ndbjtie/src/Makefile.am	2009-11-13 19:00:13 +0000
@@ -111,6 +111,9 @@ AM_CPPFLAGS = \
 		-I$(top_srcdir)/storage/ndb/include/ndbapi \
 		@JNI_INCLUDE_DIRS@
 
+# XXX for Sun Studio 12.1 compilers
+#		-DNDBJTIE_USE_WRAPPER_VARIANT
+
 ## build a shared library
 pkglib_LTLIBRARIES = libndbjtie.la
 

=== modified file 'storage/ndb/ndbjtie/src/ndbapi_jtie.hpp'
--- a/storage/ndb/ndbjtie/src/ndbapi_jtie.hpp	2009-11-11 05:12:59 +0000
+++ b/storage/ndb/ndbjtie/src/ndbapi_jtie.hpp	2009-11-13 19:00:13 +0000
@@ -25,6 +25,7 @@
 // API to implement against
 #include "NdbApi.hpp"
 #include "NdbError.hpp"
+#include "ndbapi_wrapper.hpp"
 
 // libraries
 #include "ndbjtie_defs.hpp"
@@ -1662,7 +1663,11 @@ JNIEXPORT jint JNICALL
 Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listObjects(JNIEnv * env, jobject obj, jobject p0, jint p1)
 {
     TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listObjects(JNIEnv *, jobject, jobject, jint)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
     return gcall< ttrait_c_m_n_n_NdbDictionary_Dictionary_ct, ttrait_int, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, ttrait_c_m_n_n_NdbDictionary_Object_Type_iv/*_enum_*/, &NdbDictionary::Dictionary::listObjects >(env, obj, p0, p1); // call of overloaded const/non-const method
+#else
+    return gcall< ttrait_int, ttrait_c_m_n_n_NdbDictionary_Dictionary_cr, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, ttrait_c_m_n_n_NdbDictionary_Object_Type_iv/*_enum_*/, &NdbApiWrapper::listObjects >(env, NULL, obj, p0, p1);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
 }
 
 /*
@@ -1710,7 +1715,11 @@ JNIEXPORT jint JNICALL
 Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listIndexes(JNIEnv * env, jobject obj, jobject p0, jstring p1)
 {
     TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listIndexes(JNIEnv *, jobject, jobject, jstring)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
     return gcall< ttrait_c_m_n_n_NdbDictionary_Dictionary_ct, ttrait_int, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, ttrait_utf8cstring, &NdbDictionary::Dictionary::listIndexes >(env, obj, p0, p1); // call of overloaded const/non-const method
+#else
+    return gcall< ttrait_int, ttrait_c_m_n_n_NdbDictionary_Dictionary_cr, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, ttrait_utf8cstring, &NdbApiWrapper::listIndexes >(env, NULL, obj, p0, p1);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
 }
 
 /*
@@ -1722,7 +1731,11 @@ JNIEXPORT jint JNICALL
 Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listEvents(JNIEnv * env, jobject obj, jobject p0)
 {
     TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listEvents(JNIEnv *, jobject, jobject)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
     return gcall< ttrait_c_m_n_n_NdbDictionary_Dictionary_ct, ttrait_int, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, &NdbDictionary::Dictionary::listEvents >(env, obj, p0); // call of overloaded const/non-const method
+#else
+    return gcall< ttrait_int, ttrait_c_m_n_n_NdbDictionary_Dictionary_cr, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, &NdbApiWrapper::listEvents >(env, NULL, obj, p0);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
 }
 
 /*
@@ -5796,7 +5809,11 @@ JNIEXPORT jobject JNICALL
 Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandle__Ljava_lang_String_2(JNIEnv * env, jobject obj, jstring p0)
 {
     TRACE("jobject Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandle__Ljava_lang_String_2(JNIEnv *, jobject, jstring)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
     return gcall< ttrait_c_m_n_n_NdbOperation_ct, ttrait_c_m_n_n_NdbBlob_p, ttrait_utf8cstring, &NdbOperation::getBlobHandle >(env, obj, p0); // call of overloaded const/non-const method
+#else
+    return gcall< ttrait_c_m_n_n_NdbBlob_p, ttrait_c_m_n_n_NdbOperation_cr, ttrait_utf8cstring, &NdbApiWrapper::getBlobHandle >(env, NULL, obj, p0);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
 }
 
 /*
@@ -5808,7 +5825,11 @@ JNIEXPORT jobject JNICALL
 Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandle__I(JNIEnv * env, jobject obj, jint p0)
 {
     TRACE("jobject Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandle__I(JNIEnv *, jobject, jint)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
     return gcall< ttrait_c_m_n_n_NdbOperation_ct, ttrait_c_m_n_n_NdbBlob_p, ttrait_Uint32, &NdbOperation::getBlobHandle >(env, obj, p0); // call of overloaded const/non-const method
+#else
+    return gcall< ttrait_c_m_n_n_NdbBlob_p, ttrait_c_m_n_n_NdbOperation_cr, ttrait_Uint32, &NdbApiWrapper::getBlobHandle >(env, NULL, obj, p0);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
 }
 
 /*
@@ -6205,7 +6226,11 @@ JNIEXPORT jobject JNICALL
 Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandleM__Ljava_lang_String_2(JNIEnv * env, jobject obj, jstring p0)
 {
     TRACE("jobject Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandleM__Ljava_lang_String_2(JNIEnv *, jobject, jstring)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
     return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_c_m_n_n_NdbBlob_p, ttrait_utf8cstring, &NdbOperation::getBlobHandle >(env, obj, p0); // call of overloaded const/non-const method
+#else
+    return gcall< ttrait_c_m_n_n_NdbBlob_p, ttrait_c_m_n_n_NdbOperation_r, ttrait_utf8cstring, &NdbApiWrapper::getBlobHandle >(env, NULL, obj, p0);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
 }
 
 /*
@@ -6217,7 +6242,11 @@ JNIEXPORT jobject JNICALL
 Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandleM__I(JNIEnv * env, jobject obj, jint p0)
 {
     TRACE("jobject Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandleM__I(JNIEnv *, jobject, jint)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
     return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_c_m_n_n_NdbBlob_p, ttrait_Uint32, &NdbOperation::getBlobHandle >(env, obj, p0); // call of overloaded const/non-const method
+#else
+    return gcall< ttrait_c_m_n_n_NdbBlob_p, ttrait_c_m_n_n_NdbOperation_r, ttrait_Uint32, &NdbApiWrapper::getBlobHandle >(env, NULL, obj, p0);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
 }
 
 /*

=== added file 'storage/ndb/ndbjtie/src/ndbapi_wrapper.hpp'
--- a/storage/ndb/ndbjtie/src/ndbapi_wrapper.hpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/ndbjtie/src/ndbapi_wrapper.hpp	2009-11-13 19:00:13 +0000
@@ -0,0 +1,66 @@
+/*
+ Copyright (C) 2009 Sun Microsystems, Inc.
+ All rights reserved. Use is subject to license terms.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
+*/
+/*
+ * ndbapi_wrapper.hpp
+ */
+
+#ifndef ndbapi_wrapper_hpp
+#define ndbapi_wrapper_hpp
+
+// API to implement against
+#include "NdbApi.hpp"
+
+struct NdbApiWrapper {
+    static NdbBlob * getBlobHandle() {
+        return 0;
+    }
+    
+    static NdbBlob * getBlobHandle(NdbOperation & obj, const char * anAttrName) {
+        return obj.getBlobHandle(anAttrName);
+    }
+    
+    static NdbBlob * getBlobHandle(NdbOperation & obj, Uint32 anAttrId) {
+        return obj.getBlobHandle(anAttrId);
+    }
+    
+    static NdbBlob * getBlobHandle(const NdbOperation & obj, const char * anAttrName) {
+        return obj.getBlobHandle(anAttrName);
+    }
+    
+    static NdbBlob * getBlobHandle(const NdbOperation & obj, Uint32 anAttrId) {
+        return obj.getBlobHandle(anAttrId);
+    }    
+
+    static int listIndexes(const NdbDictionary::Dictionary & obj, NdbDictionary::Dictionary::List & list, const char * tableName) {
+        return obj.listIndexes(list, tableName);
+    }
+    
+    static int listEvents(const NdbDictionary::Dictionary & obj, NdbDictionary::Dictionary::List & list) {
+        return obj.listEvents(list);
+    }
+    
+    static int listObjects(const NdbDictionary::Dictionary & obj, NdbDictionary::Dictionary::List & list, NdbDictionary::Object::Type type = NdbDictionary::Object::TypeUndefined) {
+        return obj.listObjects(list, type);
+    }
+
+    static int getNdbErrorLine(const NdbOperation & obj) {
+        return obj.getNdbErrorLine();
+    }
+};
+
+#endif // ndbapi_wrapper_hpp


Attachment: [text/bzr-bundle] bzr/martin.zaun@sun.com-20091113190013-tzvny9fjgb8wrj0c.bundle
Thread
bzr commit into mysql-5.1-telco-6.3-ndbjtie branch (martin.zaun:3113)Martin Zaun13 Nov