source: git/dyn_modules/syzextra/singularxx_defs.h @ 4eba3ad

fieker-DuValspielwiese
Last change on this file since 4eba3ad was 4eba3ad, checked in by Oleksandr Motsak <motsak@…>, 10 years ago
introduced SchreyerSyzygyComputationFlags for storing and passing ring attributes within SchreyerSyzygyComputatio chg: renamed internal functions to avoid name conflicts chg: better namespace handling
  • Property mode set to 100644
File size: 1.7 KB
Line 
1// -*- c++ -*-
2//*****************************************************************************
3/** @file singularxx_defs.h
4 *
5 * @author Alexander Dreyer
6 * @date 2009-06-15
7 *
8 * This file includes some basic definitions for the SINGULAR++ interface.
9 *
10 * @par Copyright:
11 *   (c) 2009 by The SINGULAR Team, see LICENSE file
12 *
13**/
14//*****************************************************************************
15
16// Note: inclusion of CSINGULARTypes.h at the end
17
18
19// Get configuration
20// #include "singular_config.h"
21
22#ifndef SINGULAR_singular_defs_h_
23#define SINGULAR_singular_defs_h_
24
25
26#ifdef HAVE_NAMESPACES
27
28#define BEGIN_NAMESPACE(a) namespace a {
29#define END_NAMESPACE }
30
31#define USING_NAMESPACE(a) using namespace a;
32#define FROM_NAMESPACE(a, s) a :: s
33
34#else
35
36#define BEGIN_NAMESPACE(a)
37#define END_NAMESPACE
38
39#define USING_NAMESPACE(a)
40#define FROM_NAMESPACE(a, s) s
41
42#endif
43
44
45#define SINGULARXXNAME Singular
46
47#define BEGIN_NAMESPACE_SINGULARXX BEGIN_NAMESPACE(SINGULARXXNAME)
48#define END_NAMESPACE_SINGULARXX END_NAMESPACE
49
50#define USING_NAMESPACE_SINGULARXX USING_NAMESPACE(SINGULARXXNAME)
51#define FROM_NAMESPACE_SINGULARXXNAME(s) FROM_NAMESPACE(SINGULARXXNAME, s)
52
53#define BEGIN_NAMESPACE_NONAME BEGIN_NAMESPACE()
54
55
56
57#ifndef HAVE_THROW
58#  define SINGULARXX_THROW(type) throw type();
59#else
60#  define SINGULARXX_THROW(type) Werror(type().what());
61#endif
62
63/// For optimizing if-branches
64#ifdef __GNUC__
65#define LIKELY(expression) (__builtin_expect(!!(expression), 1))
66#define UNLIKELY(expression) (__builtin_expect(!!(expression), 0))
67#else
68#define LIKELY(expression) (expression)
69#define UNLIKELY(expression) (expression)
70#endif
71
72// #include "CSingularTypes.h"
73
74#endif /* SINGULAR_singular_defs_h_ */
Note: See TracBrowser for help on using the repository browser.