Skip to content

Commit

Permalink
buildsys: add GAP prefix to several #defines
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Feb 22, 2019
1 parent 665e529 commit 7729314
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ dnl
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [enable debug mode])],
[AC_DEFINE([GAP_KERNEL_DEBUG], [1], [define if building in debug mode]),
AC_DEFINE([PRINT_BACKTRACE], [1], [to enable backtraces upon crashes])],
AC_DEFINE([GAP_PRINT_BACKTRACE], [1], [to enable backtraces upon crashes])],
[enable_debug=no]
)
AC_MSG_CHECKING([whether to enable debug mode])
Expand All @@ -224,7 +224,7 @@ AC_MSG_RESULT([$enable_memory_checking])

AC_ARG_ENABLE([valgrind],
[AS_HELP_STRING([--enable-valgrind], [enable valgrind extensions to GASMAN])],
[AC_DEFINE([MEMORY_CANARY], [1], [define if building with valgrind extensions])],
[AC_DEFINE([GAP_MEMORY_CANARY], [1], [define if building with valgrind extensions])],
[enable_valgrind=no]
)
AC_MSG_CHECKING([whether to enable valgrind extensions to GASMAN])
Expand Down Expand Up @@ -576,7 +576,7 @@ AS_IF([test "x$ARCHEXT" != "x"],
AS_IF([test "x$ARCH" != "x"],
[GAPARCH="$ARCH"])

AC_DEFINE_UNQUOTED([SYS_ARCH], ["$GAPARCH"], [for backwards compatibility])
AC_DEFINE_UNQUOTED([GAPARCH], ["$GAPARCH"], [for backwards compatibility])
AC_SUBST([GAPARCH])

AC_ARG_ENABLE([compat-mode],
Expand Down Expand Up @@ -756,7 +756,7 @@ AX_EXECINFO
AS_IF([test "x$enable_hpcgap" = xyes],[
AS_BOX([WARNING: Experimental HPC-GAP mode enabled])
dnl also enable backtrace, to help debug spurious crashes
AC_DEFINE([PRINT_BACKTRACE], [1], [to enable backtraces upon crashes])
AC_DEFINE([GAP_PRINT_BACKTRACE], [1], [to enable backtraces upon crashes])
])

dnl
Expand Down
2 changes: 1 addition & 1 deletion src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "hpc/region.h"
#endif

#if defined(HAVE_BACKTRACE) && defined(PRINT_BACKTRACE)
#if defined(HAVE_BACKTRACE) && defined(GAP_PRINT_BACKTRACE)
#include <execinfo.h>
#include <signal.h>

Expand Down
2 changes: 1 addition & 1 deletion src/gasman.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ static inline UInt IS_BAG_BODY(void * ptr)
((UInt)ptr & (sizeof(Bag) - 1)) == 0);
}

#if defined(MEMORY_CANARY)
#if defined(GAP_MEMORY_CANARY)

#include <valgrind/valgrind.h>
#include <valgrind/memcheck.h>
Expand Down
18 changes: 9 additions & 9 deletions src/gasman.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ typedef struct {
#ifdef USE_GASMAN
Bag link;
#endif
#if defined(MEMORY_CANARY)
#if defined(GAP_MEMORY_CANARY)
// The following variable is marked as not readable or writable
// in valgrind, to check for code reading before the start of a Bag.
uint64_t memory_canary_padding[8];
Expand Down Expand Up @@ -370,18 +370,18 @@ void CHANGED_BAG(Bag bag);

int IsGapObj(void *);

#elif defined(MEMORY_CANARY)
#elif defined(GAP_MEMORY_CANARY)

/****************************************************************************
**
** MEMORY_CANARY provides (basic) support for catching out-of-bounds memory
** problems in GAP. This is done through the excellent 'valgrind' program.
** valgrind is of limited use in GAP normally, because it doesn't understand
** GAP's memory manager. Enabling MEMORY_CANARY will make an executable where
** valgrind will detect memory issues.
** GAP_MEMORY_CANARY provides (basic) support for catching out-of-bounds
** memory problems in GAP. This is done through the excellent 'valgrind'
** program. Valgrind is of limited use in GAP normally, because it doesn't
** understand GAP's memory manager. Enabling GAP_MEMORY_CANARY will make an
** executable where valgrind will detect memory issues.
**
** At the moment the detection is limited to only writing off the last allocated
** block.
** At the moment the detection is limited to only writing off the last
** allocated block.
*/

void CHANGED_BAG(Bag b);
Expand Down
2 changes: 1 addition & 1 deletion src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Char * SyKernelVersion = "4.dev";
**
*V SyArchitecture . . . . . . . . . . . . . . . . name of the architecture
*/
const Char * SyArchitecture = SYS_ARCH;
const Char * SyArchitecture = GAPARCH;


/****************************************************************************
Expand Down

0 comments on commit 7729314

Please sign in to comment.