Inclusion of gprolog.h causes severe namespace pollution
Hi there, gprolog.h defines macros such as #define B (((WamWordP *) reg_bank)[NB_OF_X_REGS+0]) #define H (((WamWordP *) reg_bank)[NB_OF_X_REGS+1]) #define CP (((WamCont *) reg_bank)[NB_OF_X_REGS+3]) #define E (((WamWordP *) reg_bank)[NB_OF_X_REGS+4]) #define CS (((WamWordP *) reg_bank)[NB_OF_X_REGS+5]) #define S (((WamWordP *) reg_bank)[NB_OF_X_REGS+6]) #define STAMP (((WamWord *) reg_bank)[NB_OF_X_REGS+7]) which then remain in the namespace. The probability of conclict with user's code is quite high, and I have been bitten a couple of times already. Can something be done about that? All the best, Roberto -- Prof. Roberto Bagnara Computer Science Group Department of Mathematics, University of Parma, Italy http://www.cs.unipr.it/~bagnara/ mailto:bagnara@cs.unipr.it
Roberto Bagnara wrote:
Hi there,
gprolog.h defines macros such as
#define B (((WamWordP *) reg_bank)[NB_OF_X_REGS+0]) #define H (((WamWordP *) reg_bank)[NB_OF_X_REGS+1]) #define CP (((WamCont *) reg_bank)[NB_OF_X_REGS+3]) #define E (((WamWordP *) reg_bank)[NB_OF_X_REGS+4]) #define CS (((WamWordP *) reg_bank)[NB_OF_X_REGS+5]) #define S (((WamWordP *) reg_bank)[NB_OF_X_REGS+6]) #define STAMP (((WamWord *) reg_bank)[NB_OF_X_REGS+7])
which then remain in the namespace. The probability of conclict with user's code is quite high, and I have been bitten a couple of times already. Can something be done about that? All the best,
Roberto
That's true and will be modified in the future. For now you can undefined those symbols after the #include gprolog.h... Only a workaround... -- =============================================== Daniel Diaz University of Paris 1 INRIA Rocquencourt 75013 Paris FRANCE 78153 Le Chesnay FRANCE web: http://pauillac.inria.fr/~diaz email: Daniel.Diaz@univ-paris1.fr -- Ce message a subi une analyse antivirus par MailScanner ; il est vraisemblablement sans danger.
participants (2)
-
Daniel Diaz -
Roberto Bagnara