Undefined calling conventions in Python.h

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ben Sizer

    #16
    Re: Undefined calling conventions in Python.h

    On Jul 23, 1:19 pm, Fredrik Lundh <fred...@python ware.comwrote:
    Ben Sizer wrote:
    You should put the extern block around the #include <python.hcall
    rather than individual functions, as surely the C calling convention
    should apply to everything within.
    >
    Hello?  Python's include files are C++ safe.  I even posted a complete
    compiler session to show that I'm not making that up.
    >
    </F>
    In theory, yeah. In practice, if his compiler was somehow not
    respecting that, then a quicker fix is to enclose the #include than to
    do individual prototypes. Admittedly that might obscure the problem
    rather than solve it.

    --
    Ben Sizer

    Comment

    • Fredrik Lundh

      #17
      Re: Undefined calling conventions in Python.h

      Ben Sizer wrote:
      In theory, yeah. In practice, if his compiler was somehow not
      respecting that, then a quicker fix is to enclose the #include than to
      do individual prototypes. Admittedly that might obscure the problem
      rather than solve it.
      Well, I'd say that the should in

      You should put the extern block around the #include <python.hcall
      rather than individual functions, as surely the C calling convention
      should apply to everything within.

      makes it look way too much like "this is how you should use python.h" to
      be appropriate, given the earlier discussions in the thread, and that a
      casual inspection of the include files reveals that the included files
      contain exactly that thing.

      C compilers can be pretty stupid, indeed, but it's usually better to
      look for a solution that makes some sense (e.g. the wrong project
      settings) before blaming it all on deeper magic (it will look at this
      code if I put it here, but not if I put it there. hmm. must be a ley
      line over there. what if I add a comment?).

      </F>

      Comment

      Working...