~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to src/Kernel/Abstractions/basic.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2009-04-26 19:35:14 UTC
  • mfrom: (1.1.10 upstream) (4.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090426193514-9yo3oggdslgdls4b
Tags: 1:1.0.7.2-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* texmacs crashes if /usr/share/texmacs/TeXmacs/misc/pixmaps/unknown.ps
  is not present. Do not remove it. (Closes: #484073, #497021)
* update patches 03_mupad.dpatch, 04_axiom.dpatch, 11-desktop-file.dpatch
* fix the mime problem in gnome. Thanks to Andrea Gamba for the fix.
[kohda]
* Refined a fix for the mime problem in gnome a bit.
* Try to fix /bin/sh problem (debian/fixsh) but it is not complete fix yet.
* Try to fix hard coded settings for ipa fonts(patches/09_ipa.dpatch), 
  especially for Debian where no ipa fonts exist yet.
* Fixed obsolete Build-Depends: changed libltdl3-dev to 
  libltdl-dev | libltdl7-dev (the latter for Ubuntu?)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
* DESCRIPTION: see basic.cpp
5
5
* COPYRIGHT  : (C) 1999  Joris van der Hoeven
6
6
*******************************************************************************
7
 
* This software falls under the GNU general public license and comes WITHOUT
8
 
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
9
 
* If you don't have this file, write to the Free Software Foundation, Inc.,
10
 
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
7
* This software falls under the GNU general public license version 3 or later.
 
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
 
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
11
10
******************************************************************************/
12
11
 
13
12
#ifndef BASIC_H
14
13
#define BASIC_H
15
 
#include "tm_configure.hpp"
16
 
#include <stdlib.h>
 
14
#include "fast_alloc.hpp"
17
15
#include <math.h>
18
16
 
19
 
// g++ >= 3.2 requires
20
 
#include <iostream>
21
 
using std::ostream;
22
 
using std::cout;
23
 
using std::cerr;
24
 
// instead of include <iostream.h>
25
 
 
26
17
#ifdef HAVE_INTPTR_T
27
18
#ifdef OS_SUN
28
19
#include <inttypes.h>
53
44
#endif
54
45
typedef void* pointer;
55
46
 
56
 
#ifndef NO_FAST_ALLOC
57
 
#ifdef OS_IRIX
58
 
void* operator new (register size_t s) throw(std::bad_alloc);
59
 
void  operator delete (register void* ptr) throw();
60
 
void* operator new[] (register size_t s) throw(std::bad_alloc);
61
 
void  operator delete[] (register void* ptr) throw();
62
 
#else
63
 
void* operator new (register size_t s);
64
 
void  operator delete (register void* ptr);
65
 
void* operator new[] (register size_t s);
66
 
void  operator delete[] (register void* ptr);
67
 
#endif
68
 
#endif // not defined NO_FAST_ALLOC
69
 
int   mem_used ();
70
 
void  mem_info ();
71
 
 
72
47
#if (defined OS_WIN32 || defined __SUNPRO_CC)
73
 
#define STACK_NEW_ARRAY(name,T,size) T* name= new T[size]
74
 
#define STACK_DELETE_ARRAY(name) delete[] name
 
48
#define STACK_NEW_ARRAY(name,T,size) T* name= tm_new_array<T> (size)
 
49
#define STACK_DELETE_ARRAY(name) tm_delete_array (name)
75
50
#else
76
51
#define STACK_NEW_ARRAY(name,T,size) T name[size]
77
52
#define STACK_DELETE_ARRAY(name)
89
64
#define DEBUG_IO (debug (DEBUG_FLAG_IO))
90
65
#define DEBUG_BENCH (debug (DEBUG_FLAG_BENCH))
91
66
 
 
67
#ifdef DEBUG_ASSERT
 
68
#include <assert.h>
 
69
#define ASSERT(cond,msg) assert (cond); // msg
 
70
#else
 
71
#define ASSERT(cond,msg)
 
72
#endif
 
73
#define FAILED(msg) ASSERT(false,msg)
 
74
 
92
75
inline SI min (SI i, SI j) { if (i<j) return i; else return j; }
93
76
inline SI max (SI i, SI j) { if (i>j) return i; else return j; }
94
77
inline double min (double i, double j) { if (i<j) return i; else return j; }
131
114
******************************************************************************/
132
115
 
133
116
#define INC_COUNT(R)      { (R)->ref_count++; }
134
 
#define DEC_COUNT(R)      { if(0==--((R)->ref_count)) delete (R); }
 
117
#define DEC_COUNT(R)      { if(0==--((R)->ref_count)) tm_delete (R); }
135
118
#define INC_COUNT_NULL(R) { if ((R)!=NULL) (R)->ref_count++; }
136
 
#define DEC_COUNT_NULL(R) { if ((R)!=NULL && 0==--((R)->ref_count)) delete (R); }
 
119
#define DEC_COUNT_NULL(R) { if ((R)!=NULL && 0==--((R)->ref_count)) tm_delete (R); }
137
120
 
138
121
// concrete
139
122
#define CONCRETE(PTR)               \