From: <asf...@us...> - 2015-01-18 14:53:08
|
Revision: 60523 http://sourceforge.net/p/firebird/code/60523 Author: asfernandes Date: 2015-01-18 14:53:06 +0000 (Sun, 18 Jan 2015) Log Message: ----------- Fixed problem of local templates being not allowed in pre-C++-11 code. Modified Paths: -------------- firebird/trunk/examples/udr/UdrCppExample.cpp firebird/trunk/src/include/firebird/Message.h firebird/trunk/src/include/firebird/UdrCppEngine.h Modified: firebird/trunk/examples/udr/UdrCppExample.cpp =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-18 14:52:50 UTC (rev 60522) +++ firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-18 14:53:06 UTC (rev 60523) @@ -196,11 +196,11 @@ engine udr; ***/ FB_UDR_BEGIN_FUNCTION(wait_event) - FB_MESSAGE(InMessage, + FB_UDR_MESSAGE(InMessage, (FB_VARCHAR(31 * 4), name) ); - FB_MESSAGE(OutMessage, + FB_UDR_MESSAGE(OutMessage, (FB_INTEGER, result) ); @@ -391,12 +391,12 @@ engine udr; ***/ FB_UDR_BEGIN_PROCEDURE(gen_rows2) - FB_MESSAGE(InMessage, + FB_UDR_MESSAGE(InMessage, (FB_INTEGER, start) (FB_INTEGER, end) ); - FB_MESSAGE(OutMessage, + FB_UDR_MESSAGE(OutMessage, (FB_INTEGER, result) ); @@ -431,11 +431,11 @@ // metadata object. // n3 and n4 are on the ResultSet scope, i.e., each procedure execution have they own instances. FB_UDR_BEGIN_PROCEDURE(inc) - FB_MESSAGE(InMessage, + FB_UDR_MESSAGE(InMessage, (FB_INTEGER, count) ); - FB_MESSAGE(OutMessage, + FB_UDR_MESSAGE(OutMessage, (FB_INTEGER, n0) (FB_INTEGER, n1) (FB_INTEGER, n2) @@ -682,7 +682,7 @@ FB_UDR_BEGIN_TRIGGER(replicate_persons) // Order of fields does not need to match the fields order in the table, but it should match // the order of fields in the SQL command constructed in the initialization. - FB_TRIGGER_MESSAGE(FieldsMessage, + FB_UDR_TRIGGER_MESSAGE(FieldsMessage, (FB_INTEGER, id, "ID") (FB_BLOB, info, "INFO") ///(FB_VARCHAR(60 * 4), address, "ADDRESS") Modified: firebird/trunk/src/include/firebird/Message.h =================================================================== --- firebird/trunk/src/include/firebird/Message.h 2015-01-18 14:52:50 UTC (rev 60522) +++ firebird/trunk/src/include/firebird/Message.h 2015-01-18 14:53:06 UTC (rev 60523) @@ -29,16 +29,16 @@ #include <assert.h> #include <string.h> -#define FB_MESSAGE(name, fields) \ - FB__MESSAGE_I(name, 2, FB_BOOST_PP_CAT(FB__MESSAGE_X fields, 0), ) +#define FB_MESSAGE(name, statusType, fields) \ + FB__MESSAGE_I(name, statusType, 2, FB_BOOST_PP_CAT(FB__MESSAGE_X fields, 0), ) #define FB__MESSAGE_X(x, y) ((x, y)) FB__MESSAGE_Y #define FB__MESSAGE_Y(x, y) ((x, y)) FB__MESSAGE_X #define FB__MESSAGE_X0 #define FB__MESSAGE_Y0 -#define FB_TRIGGER_MESSAGE(name, fields) \ - FB__MESSAGE_I(name, 3, FB_BOOST_PP_CAT(FB_TRIGGER_MESSAGE_X fields, 0), \ +#define FB_TRIGGER_MESSAGE(name, statusType, fields) \ + FB__MESSAGE_I(name, statusType, 3, FB_BOOST_PP_CAT(FB_TRIGGER_MESSAGE_X fields, 0), \ FB_TRIGGER_MESSAGE_MOVE_NAMES(name, fields)) #define FB_TRIGGER_MESSAGE_X(x, y, z) ((x, y, z)) FB_TRIGGER_MESSAGE_Y @@ -46,7 +46,7 @@ #define FB_TRIGGER_MESSAGE_X0 #define FB_TRIGGER_MESSAGE_Y0 -#define FB__MESSAGE_I(name, size, fields, moveNames) \ +#define FB__MESSAGE_I(name, statusType, size, fields, moveNames) \ struct name \ { \ struct Type \ @@ -54,17 +54,15 @@ FB_BOOST_PP_SEQ_FOR_EACH_I(FB__MESSAGE_FIELD, size, fields) \ }; \ \ - template <typename StatusType> \ - static void setup(StatusType* status, ::Firebird::IMetadataBuilder* builder) \ + static void setup(statusType* status, ::Firebird::IMetadataBuilder* builder) \ { \ unsigned index = 0; \ moveNames \ FB_BOOST_PP_SEQ_FOR_EACH_I(FB__MESSAGE_META, size, fields) \ } \ \ - template <typename StatusType> \ - name(StatusType* status, ::Firebird::IMaster* master) \ - : desc(master, status, FB_BOOST_PP_SEQ_SIZE(fields), &setup<StatusType>) \ + name(statusType* status, ::Firebird::IMaster* master) \ + : desc(master, status, FB_BOOST_PP_SEQ_SIZE(fields), setup) \ { \ } \ \ Modified: firebird/trunk/src/include/firebird/UdrCppEngine.h =================================================================== --- firebird/trunk/src/include/firebird/UdrCppEngine.h 2015-01-18 14:52:50 UTC (rev 60522) +++ firebird/trunk/src/include/firebird/UdrCppEngine.h 2015-01-18 14:53:06 UTC (rev 60523) @@ -150,6 +150,13 @@ ~Impl() +#define FB_UDR_MESSAGE(name, fields) \ + FB_MESSAGE(name, FB_UDR_STATUS_TYPE, fields) + +#define FB_UDR_TRIGGER_MESSAGE(name, fields) \ + FB_TRIGGER_MESSAGE(name, FB_UDR_STATUS_TYPE, fields) + + #define FB__UDR_COMMON_IMPL \ Impl(const void* const, ::Firebird::IExternalContext* const context, \ ::Firebird::IRoutineMetadata* const aMetadata) \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |