runtime port identification

The CE ports use makedefs hosted on another platform,
so the version string generated at build time isn't really
appropriate.

Add a way to add information to the version string
at runtime for such ports.
This commit is contained in:
nethack.allison
2003-02-19 11:44:14 +00:00
parent 3d9d7f24b3
commit 0c4bd66545
4 changed files with 44 additions and 0 deletions

View File

@@ -2084,6 +2084,9 @@ E boolean FDECL(check_version, (struct version_info *,
const char *,BOOLEAN_P));
E unsigned long FDECL(get_feature_notice_ver, (char *));
E unsigned long NDECL(get_current_feature_ver);
#ifdef RUNTIME_PORT_ID
E void FDECL(append_port_id, (char *));
#endif
/* ### video.c ### */

View File

@@ -74,6 +74,37 @@
#define PORT_HELP "porthelp"
#if defined(WIN_CE_POCKETPC)
# define PORT_CE_PLATFORM "Pocket PC"
#elif defined(WIN_CE_PS2xx)
# define PORT_CE_PLATFORM "Palm-size PC 2.11"
#elif defined(WIN_CE_HPCPRO)
# define PORT_CE_PLATFORM "H/PC Pro 2.11"
#elif defined(WIN_CE_SMARTPHONE)
# define PORT_CE_PLATFORM "Smartphone 2002"
#endif
#if defined(ARM)
# define PORT_CE_CPU "ARM"
#elif defined(PPC)
# define PORT_CE_CPU "PPC"
#elif defined(ALPHA)
# define PORT_CE_CPU "ALPHA"
#elif defined(SH3)
# define PORT_CE_CPU "SH3"
#elif defined(SH4)
# define PORT_CE_CPU "SH4"
#elif defined(MIPS)
# define PORT_CE_CPU "MIPS"
#elif defined(X86)
# define PORT_CE_CPU "X86"
#else
# error Only ARM, PPC, ALPHA, SH3, SH4, MIPS and X86 supported
#endif
#define RUNTIME_PORT_ID /* trigger run-time port identification since
Makedefs is bootstrapped on a cross-platform. */
#include <string.h> /* Provides prototypes of strncmpi(), etc. */
#ifdef STRNCMPI
#define strncmpi(a,b,c) _strnicmp(a,b,c)

View File

@@ -24,6 +24,9 @@ char *buf;
Strcpy(buf, VERSION_ID);
#if defined(BETA) && defined(BETA_INFO)
Sprintf(eos(buf), " %s", BETA_INFO);
#endif
#if defined(RUNTIME_PORT_ID)
append_port_id(buf);
#endif
return buf;
}

View File

@@ -340,4 +340,11 @@ void win32_abort()
abort();
}
void
append_port_id(buf)
char *buf;
{
char *portstr = PORT_CE_PLATFORM " " PORT_CE_CPU;
Sprintf(eos(buf), " %s", portstr);
}