This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hinsen
Recipients
Date 2006-05-12.14:26:23
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=11850

Here is an illustration of my problem. Given the following three files:

-- foo.h -------------------------
#include <Python.h>

#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#endif

typedef struct {
  Py_ssize_t index;
} foo;


-- bar.h -------------------------

#include <Python.h>

#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#endif

typedef struct {
  Py_ssize_t index;
} bar;


-- foobar.c ----------------------

#include "foo.h"
#include "bar.h"

foo a;
bar b;

int main(int argc, char **argv) {
  return 0;
}

----------------------------------

I get from gcc:

gcc foobar.c 
In file included from foobar.c:1:
foo.h:1:20: error: Python.h: No such file or directory
In file included from foobar.c:2:
bar.h:4: error: redefinition of typedef 'Py_ssize_t'
foo.h:4: error: previous declaration of 'Py_ssize_t' was here

I see no solution to this problem that would work in the most general case in 
which all three files are part of different packages written by different 
authors, i.e. in the absence of a coordination.
History
Date User Action Args
2008-01-20 09:59:46adminlinkissue1485576 messages
2008-01-20 09:59:46admincreate