[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Proposal - Improved Version Checks
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Proposal - Improved Version Checks
- From: "Forrest Voight" <voights@xxxxxxxxx>
- Date: Mon, 29 Sep 2008 21:29:24 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Mon, 29 Sep 2008 21:29:27 -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:mime-version:content-type:content-transfer-encoding :content-disposition; bh=GeySgTVl0mIqfTgCfuo3UIvp2KRFaLAIU3vSfQL8gbI=; b=sDltbfwo3Jg/uHC1yUwd9h4ugd5sqNU0h6f6SEh9QJc7gamQASjtg9QnDttLLUFj6F PV5G4TeQe0u4QHookZkiwN4wDzXOOkOY4vPbdSy2KGuR5won75EK4EsZfo3xfkRTXpt3 F9EF/fJEPrpDjT2l94llymR5YqzZzoD8vHbg0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=UgdgvdEXPMIp9bw41pT6t44mCmkJJ7CgwQToK64DiB18CALJo5Ki0u7OZXFilP9f+o dVktUlSztwM5kJzYPUSioWa8aZJgTq8QEJZ1+onYYRvxfxFvUwPFotTVfRjN86EPU+7n 3aAkgZQgoJtENnIkNJfAUsVQGKpt458M1w9y0=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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