/[svn]/libgig/trunk/src/Serialization.h
ViewVC logotype

Diff of /libgig/trunk/src/Serialization.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3772 by schoenebeck, Sun May 17 17:21:52 2020 UTC revision 3773 by schoenebeck, Tue May 19 14:28:20 2020 UTC
# Line 36  Line 36 
36  #include <map>  #include <map>
37  #include <time.h>  #include <time.h>
38  #include <stdarg.h>  #include <stdarg.h>
39    #include <assert.h>
40    
41  #ifndef __has_extension  #ifndef __has_extension
42  # define __has_extension(x) 0  # define __has_extension(x) 0
# Line 411  namespace Serialization { Line 412  namespace Serialization {
412                  if (type == typeid(uint32_t)) return DataType(T_isPointer, sz, "uint32");                  if (type == typeid(uint32_t)) return DataType(T_isPointer, sz, "uint32");
413                  if (type == typeid(int64_t))  return DataType(T_isPointer, sz, "int64");                  if (type == typeid(int64_t))  return DataType(T_isPointer, sz, "int64");
414                  if (type == typeid(uint64_t)) return DataType(T_isPointer, sz, "uint64");                  if (type == typeid(uint64_t)) return DataType(T_isPointer, sz, "uint64");
415                    if (type == typeid(size_t)) {
416                        if (sz == 1)  return DataType(T_isPointer, sz, "uint8");
417                        if (sz == 2)  return DataType(T_isPointer, sz, "uint16");
418                        if (sz == 4)  return DataType(T_isPointer, sz, "uint32");
419                        if (sz == 8)  return DataType(T_isPointer, sz, "uint64");
420                        else assert(false /* unknown size_t size */);
421                    }
422                    if (type == typeid(ssize_t)) {
423                        if (sz == 1)  return DataType(T_isPointer, sz, "int8");
424                        if (sz == 2)  return DataType(T_isPointer, sz, "int16");
425                        if (sz == 4)  return DataType(T_isPointer, sz, "int32");
426                        if (sz == 8)  return DataType(T_isPointer, sz, "int64");
427                        else assert(false /* unknown ssize_t size */);
428                    }
429                  if (type == typeid(bool))     return DataType(T_isPointer, sz, "bool");                  if (type == typeid(bool))     return DataType(T_isPointer, sz, "bool");
430                  if (type == typeid(float))    return DataType(T_isPointer, sz, "real32");                  if (type == typeid(float))    return DataType(T_isPointer, sz, "real32");
431                  if (type == typeid(double))   return DataType(T_isPointer, sz, "real64");                  if (type == typeid(double))   return DataType(T_isPointer, sz, "real64");

Legend:
Removed from v.3772  
changed lines
  Added in v.3773

  ViewVC Help
Powered by ViewVC