gpg-error.h possible(?) syntax error: #define GPG_ERR_SYSTEM_ERROR (1 << 15)

Werner Koch wk at gnupg.org
Thu Nov 5 21:04:27 CET 2009


On Sun,  1 Nov 2009 11:04, hedgehogshiatus at gmail.com said:

> It is not clear to me if this is an problem with gpg-error.h or swig.

The same code with some context:

  typedef enum
    {
      GPG_ERR_NO_ERROR = 0,
      GPG_ERR_GENERAL = 1,
  [...]
      GPG_ERR_EOF = 16383,
  
      /* The following error codes are used to map system errors.  */
  #define GPG_ERR_SYSTEM_ERROR	(1 << 15)
      GPG_ERR_E2BIG = GPG_ERR_SYSTEM_ERROR | 0,
      GPG_ERR_EACCES = GPG_ERR_SYSTEM_ERROR | 1,
  [...]
      /* This is one more than the largest allowed entry.  */
      GPG_ERR_CODE_DIM = 65536
    } gpg_err_code_t;
  
Swig seems to tumble over the #define preprocessor directive within a
typedef for an enum.  That is clearly a swig problem.

To fix this you may run (a working) cpp over gpg-error.h and passing its
output to swig.  ("cpp gpg-error.h >gpg-error.i")


Shalom-Salam,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-users mailing list