Commit 751ccf16 authored by Mathieu Faverge's avatar Mathieu Faverge

Start to introduce aconfig.in file

parent 1f5c1025
......@@ -123,5 +123,10 @@ if(VITE_DBG_MEMORY_TRACE)
add_definitions(-DMEMORY_TRACE)
endif()
# Configuration header
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/ViteConfig.hpp.in"
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/ViteConfig.hpp")
add_subdirectory(src)
add_subdirectory(plugins)
......@@ -106,7 +106,7 @@ unsigned long memalloccurrent = 0;
unsigned long memallocmax = 0;
int memalloctraceflag = 0;
#ifdef MEMORY_TRACE
#ifdef VITE_DBG_MEMORY_TRACE
static FILE *trace_file;
static double trace_timestamp;
static int trace_procnum;
......@@ -244,7 +244,7 @@ void *operator new(std::size_t size) throw(std::bad_alloc)
memalloccurrent += (unsigned long)size;
memallocmax = MAX(memallocmax, memalloccurrent);
memptr++;
#ifdef MEMORY_TRACE
#ifdef VITE_DBG_MEMORY_TRACE
if (memalloctraceflag == 1)
trace_malloc(trace_file, (clockGet()-trace_timestamp),
trace_procnum, STATE_ALLOC, memalloccurrent);
......@@ -282,7 +282,7 @@ void operator delete(void *memptr)
memalloccurrent -= (unsigned long) newmemptr [0] ;
operator delete (newmemptr, std::nothrow);
#ifdef MEMORY_TRACE
#ifdef VITE_DBG_MEMORY_TRACE
if (memalloctraceflag)
trace_malloc(trace_file, (clockGet()-trace_timestamp),
trace_procnum, STATE_FREE, memalloccurrent);
......
......@@ -55,7 +55,7 @@
#ifdef MEMORY_USAGE
#include <cstdlib>
#ifdef MEMORY_TRACE
#ifdef VITE_DBG_MEMORY_TRACE
#include "common/Tools.hpp"
#include "common/TraceMemory.hpp"
#endif
......@@ -93,7 +93,7 @@
extern "C" {
#ifdef MEMORY_TRACE
#ifdef VITE_DBG_MEMORY_TRACE
/*
Function: memAllocTrace
......
/*
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
*/
/*!
* @file vite_config.hpp
* @brief This file defines all set of macro defined in cmake
* @author Mathieu Faverge
*
*/
#ifndef _VITE_CONFIG_H_
#define _VITE_CONFIG_H_
#define VITE_VERSION_MAJOR 1
#define VITE_VERSION_MINOR 2
#define VITE_VERSION_PATCH 0
/* Optimization options */
/* #undef VITE_ENABLE_SERIALIZATION */
/* #undef VITE_ENABLE_VBO */
/* #undef VITE_ENABLE_MT_PARSERS */
/* Debug options */
/* #undef VITE_DBG_MEMORY_USAGE */
/* #undef VITE_DBG_MEMORY_TRACE */
/* Trace format options */
#define VITE_ENABLE_OTF
/* #undef VITE_ENABLE_TAU */
#endif /* _VITE_CONFIG_H_ */
......@@ -45,15 +45,10 @@
*\brief This file gives some global defines and typedef.
*/
#ifndef COMMON_HPP
#define COMMON_HPP
/* Example:
* *Message::get_instance() << "Test:" << 45 << " and " << true << Message::endi;
* -> display as an informative message.
*/
#include "ViteConfig.hpp"
/*!
* \def VITE_VERSION
......@@ -70,16 +65,6 @@
* \brief the ViTE website (string)
*/
#define VITE_WEBSITE "http://vite.gforge.inria.fr"
/*!
* \def VITE_MAJOR
* \brief the vite major version (integer)
*/
#define VITE_MAJOR 1
/*!
* \def VITE_MINOR
* \brief the vite minor version (integer)
*/
#define VITE_MINOR 2
/*!
* \brief Unity for count elements such as number of states or events... NOT USED YET
......
......@@ -85,7 +85,7 @@
int main(int argc, char **argv) {
#ifdef MEMORY_TRACE
#ifdef VITE_DBG_MEMORY_TRACE
FILE * file;
double timestamp;
#endif
......@@ -94,18 +94,18 @@ int main(int argc, char **argv) {
Info::Render::_key_alt = false;/* no CTRL key pushed */
#ifdef MEMORY_TRACE
#ifdef VITE_DBG_MEMORY_TRACE
timestamp = clockGet();
file = fopen("toto.trace", "w");
memAllocTrace(file, timestamp, 0);
trace_start(file, timestamp, 0, -1);
#endif /* MEMORY_TRACE */
#endif /* VITE_DBG_MEMORY_TRACE */
Core console(argc, argv);
console.run();
#ifdef MEMORY_USAGE
#ifdef MEMORY_TRACE
#ifdef VITE_DBG_MEMORY_TRACE
trace_finish(file, (clockGet()-timestamp), 0, -1);
memAllocUntrace();
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment