On 2020-01-27 19:51, Dimitry Sibiryakov wrote:
27.01.2020 17:45, Alex Peshkoff via Firebird-devel wrote:
Am I understanding right that when ibase.h is included that constants will be in global namespace as before?

  Sure. When you write in Interface.h something like this:

namespace Firebird {
#include "pub_const.h"
}

  You'll get the constants in namespace Firebid.


Currently that will not work. We have
#define isc_spb_rpr_commit_trans        15
notation in consts_pub.h which is unaffected by namespace. And we need it cause .h file may be used in plain C code.

When you write in ibase.h

#include "pub_const.h"

  You'll get the same constants in global namespace.

Would not work out of the box.We have #ifndef FIREBIRD_IMPL_CONSTS_PUB_H protection in consts_pub.h (like in almost all other .h files) and such protection is definitely useful in public header.


  They won't conflict and either of them can be used interchangeable (if the program includes both headers).


Afraid that (provided previous issues are solved) they will conflict if someone has
using namespace Firebird;
after including 2 different headers.

Inititially I was optimistic - but looks like implementing this suggestion will rise more problems than solve.




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to