Changeset 3c8e12d in tol


Ignore:
Timestamp:
Feb 23, 2015, 9:33:51 AM (12 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
35121b1
Parents:
6efb506
Message:

refs #1825, se implementa la función PlatformInfo que retorna un conjunto con 5 elementos:

  • SystemaName: identificador del sistema operativo, ej: Linux, Windows, Darwin
  • SystemVersion: identificador de version
  • CompilerID: identifiador del compilador de C++ usado, ej GNU, MSVC
  • Processor: identificador de la CPU, ej: x86_64, AMD64
  • PointerSize: tamaño del puntero, ej: 4 (para 32 bit), 8 (para 64 bit)

Ejemplo de salida:

10:15:00 TOL> Set View(PlatformInfo(?), "");
PointerSize=4
Processor="x86_64"
CompilerID="GNU"
SystemVersion=""
SystemName="Linux"
5 elementos

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@6487 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/set_type/setgra.cpp

    r6efb506 r3c8e12d  
    30483048  contens_.RobElement(result); 
    30493049}
     3050
     3051#if !defined(TOLPLAT_SYSTEM_NAME)
     3052#if defined(UNIX)
     3053#define TOLPLAT_SYSTEM_NAME "Linux"
     3054#else
     3055#define TOLPLAT_SYSTEM_NAME "Windows"
     3056#endif
     3057#endif
     3058
     3059#if !defined(TOLPLAT_SYSTEM_VERSION)
     3060#define TOLPLAT_SYSTEM_VERSION ""
     3061#endif
     3062
     3063#if !defined(TOLPLAT_SYSTEM_PROCESSOR)
     3064#define TOLPLAT_SYSTEM_PROCESSOR "x86_64"
     3065#endif
     3066
     3067#if !defined(TOLPLAT_POINTER_SIZE)
     3068#define TOLPLAT_POINTER_SIZE sizeof(void*)
     3069#endif
     3070
     3071#if !defined(TOLPLAT_COMPILER_ID)
     3072#if defined(UNIX)
     3073#define TOLPLAT_COMPILER_ID "GNU"
     3074#else
     3075#define TOLPLAT_COMPILER_ID "MSVC"
     3076#endif
     3077#endif
     3078
     3079
     3080
     3081//--------------------------------------------------------------------
     3082DeclareContensClass(BSet, BSetTemporary, BSetPlatformInfo);
     3083DefExtOpr(1, BSetPlatformInfo, "PlatformInfo", 1, 1, "Real",
     3084          "(Real void)",
     3085          I2("Returns the platform information for which this TOL was compiled",
     3086             "Retorna la información de la plataforma para la cual fue compilado este TOL"),
     3087          BOperClassify::System_);
     3088//--------------------------------------------------------------------
     3089void BSetPlatformInfo::CalcContens()
     3090//--------------------------------------------------------------------
     3091{
     3092  BList * result = NIL;
     3093  BSyntaxObject * so;
     3094  result = Cons(so = new BContensText( "", TOLPLAT_SYSTEM_NAME), result );
     3095  so->PutName("SystemName");
     3096  result = Cons(so = new BContensText("", TOLPLAT_SYSTEM_VERSION), result );
     3097  so->PutName("SystemVersion");
     3098  result = Cons(so = new BContensText("", TOLPLAT_COMPILER_ID ), result);
     3099  so->PutName("CompilerID");
     3100  result = Cons(so = new BContensText("", TOLPLAT_SYSTEM_PROCESSOR ), result);
     3101  so->PutName("Processor");
     3102  result = Cons(so = new BContensDat("", TOLPLAT_POINTER_SIZE), result);
     3103  so->PutName("PointerSize");
     3104  contens_.RobElement(result); 
     3105}
Note: See TracChangeset for help on using the changeset viewer.