Changed a lot of platform-specific code to "simplify" it:

A Unix-like system is now considered the default.
The number of platform-specific blocks is down to:
   win32: 13, watcomc: 3, linux: 4, macosx: 16, amigaos4: 8, beos/haiku: 1
Removed linux.c, implemented the relevant functions for all platforms.
(win32) In Stats screen, included free memory report
(macosx) Conversion_ANSI: Fixed the __macosx__ with wrong case from my former 'fix', sorry.
(macosx) readline.c : Removed a manual "Update_necessaire=1", because normally
all calls to UpdateRect() will set this flag already. Don't hesitate to call 
Flush_Update() anywhere where it's lacking, but you shouldn't put it inside a  #ifdef __macosx__
(win32) Packaging: 'make ziprelease' now includes libpng13.dll and zlib1.dll
(win32) Hacked something to resolve naming conflict of MOD_SHIFT constants with windows.h
(all) Resolution: Fixed the black space that appeared between button and label,
the memory overwrite also caused resolutions above number 2 to disappear from list.
 
Tested fine on Linux (without TTF) and Windows


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@345 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2008-11-15 16:25:37 +00:00
parent b511ceafdb
commit c4f6cf7762
18 changed files with 152 additions and 268 deletions

69
aide.c
View File

@@ -23,6 +23,16 @@
*/
#include <stdio.h>
#include <string.h>
#if defined(__WIN32__)
#include <windows.h>
#elif defined(__macosx__)
#include <sys/param.h>
#include <sys/mount.h>
#elif defined (__linux__)
#include <sys/vfs.h>
#endif
#include "const.h"
#include "struct.h"
#include "global.h"
@@ -34,25 +44,6 @@
#include "sdlscreen.h"
#include "texte.h"
#include <string.h>
#ifdef __linux__
#ifdef __macosx__
#include <sys/param.h>
#include <sys/mount.h>
#else
#include <sys/vfs.h>
#endif
#else
#ifndef __amigaos4__
#ifndef __BEOS__
#ifndef __HAIKU__
#include <windows.h>
#endif
#endif
#endif
#endif
extern char SVNRevision[];
// -- Menu d'aide -----------------------------------------------------------
@@ -316,19 +307,7 @@ void Bouton_Stats(void)
char Buffer[37];
dword Utilisation_couleur[256];
unsigned long long freeRam;
#ifdef __linux__
struct statfs Informations_Disque;
uint64_t Taille = 0;
#else
#if defined(__amigaos4__)||defined(__BEOS__)||defined(__HAIKU__)
uint64_t Taille = 0;
#else
unsigned __int64 Taille;
ULARGE_INTEGER tailleU;
#endif
#endif
uint64_t Taille = 0;
Ouvrir_fenetre(310,174,"Statistics");
@@ -369,16 +348,22 @@ void Bouton_Stats(void)
sprintf(Buffer,"Free space on %c:",Principal_Repertoire_courant[0]);
Print_dans_fenetre(10,67,Buffer,STATS_COULEUR_TITRES,CM_Noir);
#ifdef __linux__
statfs(Principal_Repertoire_courant,&Informations_Disque);
Taille=(uint64_t) Informations_Disque.f_bfree * (uint64_t) Informations_Disque.f_bsize;
#else
#if defined(__amigaos4__)||defined(__BEOS__)||defined(__HAIKU__)
#else
GetDiskFreeSpaceEx(Principal_Repertoire_courant,&tailleU,NULL,NULL);
Taille = tailleU.QuadPart;
#endif
#endif
#if defined(__WIN32__)
{
ULARGE_INTEGER tailleU;
GetDiskFreeSpaceEx(Principal_Repertoire_courant,&tailleU,NULL,NULL);
Taille = tailleU.QuadPart;
}
#elif defined(__linux__) || (__macosx__)
// Note: under MacOSX, both macros are defined anyway.
{
struct statfs Informations_Disque;
statfs(Principal_Repertoire_courant,&Informations_Disque);
Taille=(uint64_t) Informations_Disque.f_bfree * (uint64_t) Informations_Disque.f_bsize;
}
#else
// Free disk space is only for shows. Other platforms can display 0.
#endif
if(Taille > (100ULL*1024*1024*1024))
sprintf(Buffer,"%d Gigabytes",(unsigned int)(Taille/(1024*1024*1024)));