1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-11-27 03:32:15 -05:00

move cpu arch stuff to separate function

This commit is contained in:
berkeviktor@aol.com 2011-05-30 21:15:39 +02:00
parent bfb6120116
commit b85f311ddd
3 changed files with 20 additions and 14 deletions

View File

@ -647,6 +647,24 @@ get_mhz (void)
return 0; /* fails on Win9x */ return 0; /* fails on Win9x */
} }
int
get_cpu_arch (void)
{
SYSTEM_INFO si;
unsigned short int cpu_arch;
GetSystemInfo (&si);
if (si.wProcessorArchitecture == 9)
{
return 64;
}
else
{
return 86;
}
}
char * char *
get_cpu_str (void) get_cpu_str (void)
{ {

View File

@ -45,6 +45,7 @@ char *errorstring (int err);
int waitline (int sok, char *buf, int bufsize, int); int waitline (int sok, char *buf, int bufsize, int);
#ifdef WIN32 #ifdef WIN32
int waitline2 (GIOChannel *source, char *buf, int bufsize); int waitline2 (GIOChannel *source, char *buf, int bufsize);
int get_cpu_arch (void);
#else #else
#define waitline2(source,buf,size) waitline(serv->childread,buf,size,0) #define waitline2(source,buf,size) waitline(serv->childread,buf,size,0)
#endif #endif

View File

@ -88,19 +88,6 @@ menu_about (GtkWidget * wid, gpointer sess)
char buf[512]; char buf[512];
const char *locale = NULL; const char *locale = NULL;
extern GtkWindow *parent_window; /* maingui.c */ extern GtkWindow *parent_window; /* maingui.c */
SYSTEM_INFO si;
unsigned short int cpu_arch;
GetSystemInfo (&si);
if (si.wProcessorArchitecture == 9)
{
cpu_arch = 64;
}
else
{
cpu_arch = 86;
}
if (about) if (about)
{ {
@ -146,7 +133,7 @@ menu_about (GtkWidget * wid, gpointer sess)
gtk_minor_version, gtk_minor_version,
gtk_micro_version, gtk_micro_version,
(portable_mode () ? "Yes" : "No"), (portable_mode () ? "Yes" : "No"),
cpu_arch get_cpu_arch ()
#else #else
"%s\n\n" "%s\n\n"
"%s\n" "%s\n"