Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Utility Functions

Functions

const char * POSH_GetArchString (void)
 

Detailed Description

Function Documentation

const char* POSH_GetArchString ( void  )

Returns a string describing this platform's basic attributes.

POSH_GetArchString() reports on an architecture's statically determined attributes. In addition, it will perform run-time verification checks to make sure the various platform specific functions work. If an error occurs, please contact me at poshl.nosp@m.ib@p.nosp@m.oshli.nosp@m.b.or.nosp@m.g so we can try to resolve what the specific failure case is.

Returns
a string describing this platform on success, or a string in the form "*ERROR: [text]" on failure. You can simply check to see if the first character returned is '*' to verify an error condition.

Definition at line 159 of file posh.cpp.

References POSH_64BIT_INTEGER_STRING, POSH_ENDIAN_STRING, POSH_FLOAT_STRING, POSH_OS_STRING, POSH_POINTER_STRING, s_testEndianess(), s_testFloatingPoint(), and s_testSerialization().

Referenced by AccountServer::AccountServer(), and NetClient::NetClient().

160 {
161  const char *err;
162  const char *s = "OS:.............." POSH_OS_STRING "\n"
163  "CPU:............." POSH_CPU_STRING "\n"
164  "endian:.........." POSH_ENDIAN_STRING "\n"
165  "ptr size:........" POSH_POINTER_STRING "\n"
166  "64-bit ints......" POSH_64BIT_INTEGER_STRING "\n"
167  "floating point..." POSH_FLOAT_STRING "\n";
168 
169  /* test endianess */
170  err = s_testEndianess();
171  if (err != 0)
172  return err;
173  /* test serialization */
174  err = s_testSerialization();
175  if (err != 0)
176  return err;
177 #if !defined POSH_NO_FLOAT
178  /* check that our floating point support is correct */
179  err = s_testFloatingPoint();
180  if (err != 0)
181  return err;
182 #endif
183 
184  return s;
185 }