wxdirect does not support conditional compilation, I'm afraid. It's a large part of the reason why there are separate branches for wxWidgets 2.8 and 2.9.

Adding a real C preprocessor to wxdirect is a pretty large task.

The usual approach we have used in the past is:
* Define function in the header read by wxdirect
* Define a 'NULL' implementation as well as the correct one, e.g.

In wxc_glue.h
int wxSomeClass_GetSomeParam( TSelf(wxSomeClass), int param1, int param2);

in SomeClass.cpp
EWXWEXPORT(int,wxSomeClass_GetSomeParam)(wxSomeClass* self, int param1, int param2)
{
#if (wxVERSION_NUMBER < 2900)
    return 0;
#else
    // Do the real wrapping
#endif
}

This is far from ideal, but it is the simplest workaround to get things compiling. You can use wxCHECK_VERSION above as well - I think the logic is inverted, but the code is otherwise similar.

Jeremy


On 9 June 2013 21:52, Charles the Hawk <charlesthehawk@yahoo.com> wrote:
At first I installed the 90.0.1 from the older site.  I had to modify
wxdirect to do an "import Foreign.C.Types" to get rid of the arg type
errors and change the pointer assignment in eljpen.cpp that others have
mentioned.  It was working fine so I installed the 90.1 from Atze's repo
into a sandbox as described in the wiki.  I thought I changed the path
to use the 90.1 wxdirect but it's possible the older modified wxdirect
was running.  I'll try to play around with it some tomorrow and make
sure my modified wxdirect isn't being run.  But I definitely had to
change all the CHECK_VERSIONs to 2,9,4 or they could be commented out as
Blair suggested.

I think we need to decide what to do on conditional compiles. Either 1)
modify wxdirect to handle them (way over my head), 2) no conditionals in
the headers wxdirect processes which also means to leave out any new
function not in a specific lower version, or 3) require a specific
higher version.  It seems to me that #2 is probably the simplest and
thus best way to go as that should work on more installs without
requiring modifications unless it turns out that SetDeviceClippingRegion
is actually required in 2.9.4 installs.

On 06/09/2013 07:31 PM, harry wrote:
> Blair Archibald <mrblairarchibald@...> writes:
>
>> I used this repo: https://github.com/atzedijkstra/wxHaskell
>> Using wxWidgets 2.9.4, and GHC 7.6.3 the only change needed is in
> wxc/src/cpp/eljdc.cpp line 214 (the #if wxCHECK_VERSION(2,9,5) should be
> commented out - or at least had to be on my setup.
>> Then a simple: cabal install ./wxdirect ./wxc ./wxcore ./wx
>> Should hopefully get you up and running, let me know how it goes.
> I used that one as well, and got a ton of "Unacceptable argument type in
> foreign declaration" errors, perhaps related to
> http://hackage.haskell.org/trac/ghc/ticket/5610.
>
>
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. A cloud service to automate IT design, transition and operations
> 2. Dashboards that offer high-level views of enterprise services
> 3. A single system of record for all IT processes
> http://p.sf.net/sfu/servicenow-d2d-j
> _______________________________________________
> wxhaskell-devel mailing list
> wxhaskell-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
wxhaskell-devel mailing list
wxhaskell-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel