From 2a79bfe1cb5d6772e589901755c83847c9a6353a Mon Sep 17 00:00:00 2001 From: Viktor UZLOV Date: Mon, 25 Jan 2021 09:42:07 +0300 Subject: [PATCH] add 64bit options and typedef --- CMakeLists.txt | 1 + idl/CMakeLists.txt | 2 ++ idl/SALOME_Types_IDS.idl.in | 32 ++++++++++++++++++++++++++++++++ src/Basics/CMakeLists.txt | 1 + src/Basics/smIdType.hxx | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 idl/SALOME_Types_IDS.idl.in create mode 100644 src/Basics/smIdType.hxx diff --git a/CMakeLists.txt b/CMakeLists.txt index cec193a87..78ff10ca2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,7 @@ OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) # Advanced: OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF) OPTION(SALOME_USE_LIBBATCH "Use LibBatch in KERNEL" OFF) +OPTION(SALOME_USE_64BIT_IDS "Size of IDs to refer cells and nodes. 32 bits when OFF (default), 64 bits when ON." ON) CMAKE_DEPENDENT_OPTION(SALOME_PACO_PARALLEL "Build with PACO (implies SALOME_USE_MPI)" OFF "NOT SALOME_LIGHT_ONLY" OFF) CMAKE_DEPENDENT_OPTION(SALOME_USE_MPI "Use MPI containers" OFF diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index fcd45f500..2202d6876 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -25,6 +25,7 @@ INCLUDE_DIRECTORIES( ) SALOME_CONFIGURE_FILE(Calcium_Ports.idl.in Calcium_Ports.idl) +SALOME_CONFIGURE_FILE(SALOME_Types_IDS.idl.in SALOME_Types_IDS.idl) SET(SalomeIDLKernel_IDLSOURCES SALOME_Exception.idl @@ -56,6 +57,7 @@ SET(SalomeIDLKernel_IDLSOURCES SALOME_CommonTypes.idl SALOME_ExternalServerLauncher.idl ${CMAKE_CURRENT_BINARY_DIR}/Calcium_Ports.idl + ${CMAKE_CURRENT_BINARY_DIR}/SALOME_Types_IDS.idl ) IF(SALOME_USE_MPI) diff --git a/idl/SALOME_Types_IDS.idl.in b/idl/SALOME_Types_IDS.idl.in new file mode 100644 index 000000000..d0e7ad963 --- /dev/null +++ b/idl/SALOME_Types_IDS.idl.in @@ -0,0 +1,32 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef __SALOME_TYPES_IDS_IDL__ +#define __SALOME_TYPES_IDS_IDL__ + +module SALOME +{ + #ifndef SALOME_USE_64BIT_IDS + typedef long smIdType; + #else + typedef long long smIdType; + #endif +}; + +#endif diff --git a/src/Basics/CMakeLists.txt b/src/Basics/CMakeLists.txt index c71e78f94..098b63b8a 100644 --- a/src/Basics/CMakeLists.txt +++ b/src/Basics/CMakeLists.txt @@ -29,6 +29,7 @@ SET(SALOMEBasics_SOURCES BasicsGenericDestructor.hxx Basics_Utils.hxx Basics_DirUtils.hxx + smIdType.hxx ) ADD_LIBRARY(SALOMEBasics ${SALOMEBasics_SOURCES}) diff --git a/src/Basics/smIdType.hxx b/src/Basics/smIdType.hxx new file mode 100644 index 000000000..5090b0456 --- /dev/null +++ b/src/Basics/smIdType.hxx @@ -0,0 +1,34 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA) +// File : smIdType.hxx + +#ifndef _SMIDTYPE_HXX_ +#define _SMIDTYPE_HXX_ + +#include + +#ifndef SALOME_USE_64BIT_IDS +typedef std::int32_t smIdType; +#else +typedef std::int64_t smIdType; +#endif + +#endif //_SMIDTYPE_HXX_ -- 2.39.2