[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Proposal - Improved Version Checks
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Proposal - Improved Version Checks
- From: "René Dudfield" <renesd@xxxxxxxxx>
- Date: Tue, 30 Sep 2008 11:39:11 +1000
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Mon, 29 Sep 2008 21:39:18 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Ga2REUYqdhsSmSIGIxrPtP8ZULtVSnCb+69Zq3vS2gc=; b=txJDJVf8pufDQk2wKjpE8PIBjNQ1AxWE1MER86ak8LLk5qhdaJA9ln5GXUnmpQ2rwH qQ0tZumLcbqm+6QPJ0cawAETlDoMTWn4ZFcxBsYzxmOH07xEkGjOLtLIUEJSPlVnJnIQ hs0tuJy2lGtgS5pQeciKib+CYgmFeOk5wvvOI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=sG66hTpvJQxkkLUlk5gtuKRbtLBT0tySkKXEb3aUfps17vH0xspuxvXDrhXWSqLlhT 21SMh2BoyfrzV4Cgpv3kKCgko2QMXypmUYyod8s1XLB1IKPjhoG021ZlhX1gDplKfTN7 1oYf7pAdSM+HdXL5MoMcRg92MYFRGSNatv6eQ=
- In-reply-to: <b572c9e10809291829q467f08fbre3f495bfce2ccbd7@xxxxxxxxxxxxxx>
- References: <b572c9e10809291829q467f08fbre3f495bfce2ccbd7@xxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Sounds good.
On Tue, Sep 30, 2008 at 11:29 AM, Forrest Voight <voights@xxxxxxxxx> wrote:
> Version checks like this are very bad:
>
> #if MIX_MAJOR_VERSION>=1 && MIX_MINOR_VERSION>=2 && MIX_PATCHLEVEL>=3
> (line 98 src/music.c)
>
> This is a proposal to fix them.
>
> They would be changed to something like this:
>
> #if MIX_VERSION_ATLEAST(1, 2, 3)
>
> All that needs to be done to implement this is to add this to pygame.h.
>
> #ifndef MIX_COMPILEDVERSION
> #define MIX_COMPILEDVERSION SDL_VERSIONNUM(MIX_MAJOR_VERSION,
> MIX_MINOR_VERSION, MIX_PATCHLEVEL)
> #endif
> #ifndef MIX_VERSION_ATLEAST
> #define MIX_VERSION_ATLEAST(X, Y, Z) (MIX_COMPILEDVERSION >=
> SDL_VERSIONNUM(X, Y, Z))
> #endif
>