realbasic-nug
[Top] [All Lists]

Re: Declares different on Win v Mac?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Declares different on Win v Mac?
From: Frank Condello <developer at chaoticbox dot com>
Date: Tue, 9 Aug 2005 17:10:39 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <5c8121ef0508091052c482c3d at mail dot gmail dot com> <5c8121ef05080911236b9a2123 at mail dot gmail dot com> <EC6E389D-410E-46E6-B6CB-0830AA5F6A57 at ljug dot com> <5c8121ef05080912024361f9a5 at mail dot gmail dot com> <D1D7EB0E-0B2E-42B9-8E71-3434541FF95C at ljug dot com> <5c8121ef050809130057217c90 at mail dot gmail dot com> <46e73e096e851f1393a1dddb0a0d364b at declareSub dot com> <5c8121ef05080913151d0b8b42 at mail dot gmail dot com> <C43ED94A-C2BC-49AF-8A67-F2D538260F13 at ljug dot com> <5c8121ef05080913211c0599ad at mail dot gmail dot com> <5c8121ef05080913507b40adaa at mail dot gmail dot com>
On 9-Aug-05, at 4:50 PM, Ken Mankoff wrote:

We'd have to redesign the entire Declare system and much of the compiler frontend to fix this problem; it is an error not of implementation but of
design.

Everyone seems to be missing the real issue - if two declares confuse the compiler, the obvious solution is to use one declare. So, if RB let you define constants for build environments, i.e. "Mach-O Debug" vs. "Mach-O Release" everything would be fine.

An alternate (better) solution would be to provide a post-linker "copy files" phase so we can stuff dylibs into the app bundle where they belong.

@Ken; If you've only got a few declares to this library, try defining constants locally in each method:

    #If TargetMacOS
    #If DebugBuild
    Const libname = "aoeu"
    #else
    Const libname = "aoeuX"
    #endif
    #elseif TargetWin32
    Const libname = "aoeuW"
    #endif

    soft declare function foo lib libname ( baz as integer ) as integer

This isn't an elegant solution, but it should work...

Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>