mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 18:43:02 +01:00
Fixed problem of local templates being not allowed in pre-C++-11 code.
This commit is contained in:
parent
96e003bbc3
commit
c697a0268a
@ -196,11 +196,11 @@ create function wait_event (
|
||||
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 @@ create procedure gen_rows2 (
|
||||
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 @@ create procedure inc (
|
||||
// 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_END_TRIGGER
|
||||
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")
|
||||
|
@ -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) \
|
||||
{ \
|
||||
} \
|
||||
\
|
||||
|
@ -150,6 +150,13 @@ namespace Firebird
|
||||
~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) \
|
||||
|
Loading…
Reference in New Issue
Block a user