Identify type of executable in Windows
For Windows, this just uses the RUNTIME_PORT_ID hook that was already in the code to identify which executable you are running Mike
This commit is contained in:
@@ -109,6 +109,10 @@ extern void FDECL(interject, (int));
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define RUNTIME_PORT_ID /* trigger run-time port identification for
|
||||||
|
* identification of exe CPU architecture
|
||||||
|
*/
|
||||||
|
|
||||||
/* The following is needed for prototypes of certain functions */
|
/* The following is needed for prototypes of certain functions */
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#include <process.h> /* Provides prototypes of exit(), spawn() */
|
#include <process.h> /* Provides prototypes of exit(), spawn() */
|
||||||
|
|||||||
@@ -313,6 +313,7 @@ genericptr_t ptr2;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
interject(interjection_type)
|
interject(interjection_type)
|
||||||
int interjection_type;
|
int interjection_type;
|
||||||
@@ -320,6 +321,36 @@ int interjection_type;
|
|||||||
if (interjection_type >= 0 && interjection_type < INTERJECTION_TYPES)
|
if (interjection_type >= 0 && interjection_type < INTERJECTION_TYPES)
|
||||||
msmsg(interjection_buf[interjection_type]);
|
msmsg(interjection_buf[interjection_type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef RUNTIME_PORT_ID
|
||||||
|
/*
|
||||||
|
* _M_IX86 is Defined for x86 processors. This is not defined for x64 processors.
|
||||||
|
* _M_X64 is Defined for x64 processors.
|
||||||
|
* _M_IA64 is Defined for Itanium Processor Family 64-bit processors.
|
||||||
|
* _WIN64 is Defined for applications for Win64.
|
||||||
|
*/
|
||||||
|
# ifndef _M_IX86
|
||||||
|
# ifdef _M_X64
|
||||||
|
# define TARGET_PORT "(x64) "
|
||||||
|
# endif
|
||||||
|
# ifdef _M_IA64
|
||||||
|
# define TARGET_PORT "(IA64) "
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifndef TARGET_PORT
|
||||||
|
# define TARGET_PORT "(x86) "
|
||||||
|
# endif
|
||||||
|
|
||||||
|
void
|
||||||
|
append_port_id(buf)
|
||||||
|
char *buf;
|
||||||
|
{
|
||||||
|
char *portstr = TARGET_PORT;
|
||||||
|
Sprintf(eos(buf), " %s", portstr);
|
||||||
|
}
|
||||||
|
# endif /* RUNTIME_PORT_ID */
|
||||||
|
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
|
||||||
/*winnt.c*/
|
/*winnt.c*/
|
||||||
|
|||||||
Reference in New Issue
Block a user