Re: [Firebird-devel] udrcpp_example

2017-07-06 Thread Adriano dos Santos Fernandes
On 06/07/2017 08:27, Paul Reeves wrote:
> They both compile under MSVC10. I tested with 32 and 64-bit.
>
>
Thanks. I committed the fix.


Adriano


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] udrcpp_example

2017-07-06 Thread Paul Reeves
On Wed, 5 Jul 2017 12:25:11 -0300 Adriano dos Santos Fernandes wrote

> On 04/07/2017 11:33, Paul Reeves wrote:
> > Building udrcpp_example fails under windows, and has done since at
> > least the final release of Firebird 3.0. Unfortunately the build
> > process doesn't detect the error. I shall commit a fix for that in a
> > moment.
> >
> > Here is the error (repeated many times) :
> >
> > error C2896: 'bool
> > Firebird::Udr::FactoryRegistration::run(Firebird::CheckStatusWrapper
> > *,Firebird::IUdrPlugin *,void (__thiscall Firebird::IUdrPlugin::*
> > )(Firebird::CheckStatusWrapper *,const char *,T
> > *),Firebird::Udr::RegistrationNode *)' : cannot use function
> > template 'void Firebird::IUdrPlugin::registerFunction(StatusType
> > *,const char *,Firebird::IUdrFunctionFactory *)' as a function
> > argument
> >
> >  
> Paul, please tests these patches (separately) and report the results
> (including line numbers if has errors).
> 
> 

They both compile under MSVC10. I tested with 32 and 64-bit.


Paul

-- 
Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird
 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] udrcpp_example

2017-07-05 Thread Adriano dos Santos Fernandes
On 04/07/2017 11:33, Paul Reeves wrote:
> Building udrcpp_example fails under windows, and has done since at
> least the final release of Firebird 3.0. Unfortunately the build
> process doesn't detect the error. I shall commit a fix for that in a
> moment.
>
> Here is the error (repeated many times) :
>
> error C2896: 'bool
> Firebird::Udr::FactoryRegistration::run(Firebird::CheckStatusWrapper
> *,Firebird::IUdrPlugin *,void (__thiscall Firebird::IUdrPlugin::*
> )(Firebird::CheckStatusWrapper *,const char *,T
> *),Firebird::Udr::RegistrationNode *)' : cannot use function
> template 'void Firebird::IUdrPlugin::registerFunction(StatusType
> *,const char *,Firebird::IUdrFunctionFactory *)' as a function argument
>
>
Paul, please tests these patches (separately) and report the results
(including line numbers if has errors).


Adriano

diff --git a/src/include/firebird/UdrCppEngine.h 
b/src/include/firebird/UdrCppEngine.h
index ce949bd..26ef5a0 100644
--- a/src/include/firebird/UdrCppEngine.h
+++ b/src/include/firebird/UdrCppEngine.h
@@ -330,13 +330,13 @@ public:
{
CheckStatusWrapper statusWrapper(status);
 
-   if (!run(, plugin, ::registerFunction, 
regFunctions))
+   if (!run(, plugin, 
::registerFunction, regFunctions))
return;
 
-   if (!run(, plugin, 
::registerProcedure, regProcedures))
+   if (!run(, plugin, 
::registerProcedure, regProcedures))
return;
 
-   if (!run(, plugin, ::registerTrigger, 
regTriggers))
+   if (!run(, plugin, 
::registerTrigger, regTriggers))
return;
}
 
diff --git a/src/include/firebird/UdrCppEngine.h 
b/src/include/firebird/UdrCppEngine.h
index ce949bd..118e63d 100644
--- a/src/include/firebird/UdrCppEngine.h
+++ b/src/include/firebird/UdrCppEngine.h
@@ -330,13 +330,22 @@ public:
{
CheckStatusWrapper statusWrapper(status);
 
-   if (!run(, plugin, ::registerFunction, 
regFunctions))
+   void (IUdrPlugin::*regFunction)(CheckStatusWrapper*, const 
char*, IUdrFunctionFactory*) =
+   ::registerFunction;
+
+   void (IUdrPlugin::*regProcedure)(CheckStatusWrapper*, const 
char*, IUdrProcedureFactory*) =
+   ::registerProcedure;
+
+   void (IUdrPlugin::*regTrigger)(CheckStatusWrapper*, const 
char*, IUdrTriggerFactory*) =
+   ::registerTrigger;
+
+   if (!run(, plugin, regFunction, regFunctions))
return;
 
-   if (!run(, plugin, 
::registerProcedure, regProcedures))
+   if (!run(, plugin, regProcedure, regProcedures))
return;
 
-   if (!run(, plugin, ::registerTrigger, 
regTriggers))
+   if (!run(, plugin, regTrigger, regTriggers))
return;
}
 
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdotFirebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] udrcpp_example

2017-07-04 Thread Adriano dos Santos Fernandes
On 04/07/2017 12:39, Alex via Firebird-devel wrote:
>
>
> On 04.07.2017 17:33, Paul Reeves wrote:
>> Building udrcpp_example fails under windows, and has done since at
>> least the final release of Firebird 3.0. Unfortunately the build
>> process doesn't detect the error.
>
> That's a pity. Very interesting feature but people fail to use a sample.
>

Looks like not sample only, but feature is not usable with the given
compiler.


> Yes. Looks like we stepped on a limitation of MS compiler. Let's wait
> for comments from Adriano.
>

I must check it with more deeply.

At first, the code seems wrong, as registerFunction uses
ThrowStatusWrapper and run method expects a function using
CheckStatusWrapper.


Adriano


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] udrcpp_example

2017-07-04 Thread Dimitry Sibiryakov

04.07.2017 17:51, Alex via Firebird-devel wrote:
SEC$USERS is a table but not ordinary - it gathers lists of users from auth plugins on the 
fly.


  I just say that it could use UDR transparent mechanic instead of "engine 
magic".


--
  WBR, SD.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] udrcpp_example

2017-07-04 Thread Alex via Firebird-devel

On 04.07.2017 18:43, Dimitry Sibiryakov wrote:

04.07.2017 17:39, Alex via Firebird-devel wrote:

That's a pity. Very interesting feature but people fail to use a sample.


  BTW, this feature also could have wider usage in server as well. For 
example, SEC$USERS can be an UDR, gathering list of users from auth 
plugins on the fly instead of current ordinary table.




SEC$USERS is a table but not ordinary - it gathers lists of users from 
auth plugins on the fly. See jrd/UserManagement. More or less like 
monitoring tables do.




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] udrcpp_example

2017-07-04 Thread Paul Reeves
On Tue, 4 Jul 2017 18:39:40 +0300 Alex via Firebird-devel wrote

 
> BTW - what version of VS fails? 

MSVC10 - the reference compiler for the Firebird 3 Windows builds.


> What does newest version say about this place?

I've only tried this so far on my FB 3 Build VM. Only MSVC10 is
installed there. I'll try this on a development VM later.


Paul

-- 
Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird
 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] udrcpp_example

2017-07-04 Thread Alex via Firebird-devel



On 04.07.2017 17:33, Paul Reeves wrote:

Building udrcpp_example fails under windows, and has done since at
least the final release of Firebird 3.0. Unfortunately the build
process doesn't detect the error.


That's a pity. Very interesting feature but people fail to use a sample.


I shall commit a fix for that in a
moment.

Here is the error (repeated many times) :

error C2896: 'bool
Firebird::Udr::FactoryRegistration::run(Firebird::CheckStatusWrapper
*,Firebird::IUdrPlugin *,void (__thiscall Firebird::IUdrPlugin::*
)(Firebird::CheckStatusWrapper *,const char *,T
*),Firebird::Udr::RegistrationNode *)' : cannot use function
template 'void Firebird::IUdrPlugin::registerFunction(StatusType
*,const char *,Firebird::IUdrFunctionFactory *)' as a function argument


Shall I log this as a bug?


Yes. Looks like we stepped on a limitation of MS compiler. Let's wait 
for comments from Adriano.


BTW - what version of VS fails? What does newest version say about this 
place?



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel