Skip to content

Commit

Permalink
CMake: Drop stdlib.h detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Feb 6, 2025
1 parent 58c467a commit 2b3b5c8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ include (CheckIncludeFile)
check_include_file (dirent.h OPENTURNS_HAVE_DIRENT_H )
check_include_file (dlfcn.h OPENTURNS_HAVE_DLFCN_H )
check_include_file (libgen.h OPENTURNS_HAVE_LIBGEN_H )
check_include_file (stdlib.h OPENTURNS_HAVE_STDLIB_H )
check_include_file (sys/stat.h OPENTURNS_HAVE_SYS_STAT_H )
check_include_file (sys/types.h OPENTURNS_HAVE_SYS_TYPES_H )

Expand Down
3 changes: 0 additions & 3 deletions lib/include/OTconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@
/* Define to 1 if you have the openblas library. */
#cmakedefine OPENTURNS_HAVE_OPENBLAS

/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine OPENTURNS_HAVE_STDLIB_H

/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine OPENTURNS_HAVE_SYS_STAT_H

Expand Down
27 changes: 0 additions & 27 deletions lib/include/openturns/OTprivate.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,31 +75,4 @@
*/
#include "openturns/OTmemory.hxx"

/*
* Assertions are needed to ensure invariant respect
*/
#include <cassert>

/*
* Some templates to ease C memory allocation
*/
#include "openturns/OTconfig.hxx"

#ifdef OPENTURNS_HAVE_STDLIB_H
#include <stdlib.h>
#endif

template <class T>
T * newC(size_t count = 1)
{
T * ptr = static_cast<T *>( calloc( count, sizeof(T) ) );
return ptr;
}

template <class T>
void deleteC(const T * ptr)
{
free( const_cast<T *>( ptr ) );
}

#endif /* OPENTURNS_OTPRIVATE_HXX */

0 comments on commit 2b3b5c8

Please sign in to comment.