Mercurial > emacs
comparison src/gmalloc.c @ 26526:b7438760079b
* callproc.c (strerror): Remove decl.
* fileio.c (strerror): Likewise.
* process.c (strerror): Likewise.
* emacs.c (strerror): Likewise.
(Vsystem_messages_locale): Renamed from Vmessages_locale.
All uses changed.
(Vprevious_system_messages_locale): Likewise, from
Vprevious_messages_locale.
(Vsystem_time_locale): Likewise, from Vtime_locale.
(Vprevious_system_time_locale): Likewise, from Vprevious_time_locale.
(ABORT_RETURN_TYPE): New macro.
(abort): Return type is now ABORT_RETURN_TYPE.
(main): Always invoke init_signals, even if POSIX_SIGNALS is not
defined.
(syms_of_emacs): messages-locale -> system-messages-locale,
previous-messages-locale -> previous-system-messages-locale,
time-locale -> system-time-locale,
previous-time-locale -> previous-system-time-locale.
* gmalloc.c (PP, __ptr_t): Assume ANSI C if STDC_HEADERS is defined.
(const): Do not define; that's config.h's job.
(<limits.h>): Include if HAVE_LIMITS_H is defined.
(CHAR_BIT): Move test for definedness outside of limits.h condition.
(<stddef.h>): Include if STDC_HEADERS is defined.
(FREE_RETURN_TYPE): New macro.
(free): Return type is now FREE_RETURN_TYPE.
* lisp.h (synchronize_system_time_locale): Renamed from
synchronize_time_locale. All uses changed.
(synchronize_system_messages_locale): Likewise, from
synchronize_messages_locale.
* process.c (sys_siglist): Remove.
* syntax.c (scan_sexps_forward): Use abort, not assert.
* sysdep.c (my_sys_siglist): New var.
(sys_siglist): New macro. Remove old initialized vars of same name.
(init_signals): Initialize sys_siglist.
* xfns.c (abort): Remove decl; stdlib.h now does this.
author | Paul Eggert <eggert@twinsun.com> |
---|---|
date | Mon, 22 Nov 1999 08:19:51 +0000 |
parents | b7aa6ac26872 |
children | f9aeac6780a1 |
comparison
equal
deleted
inserted
replaced
26525:4df5920724de | 26526:b7438760079b |
---|---|
34 | 34 |
35 #ifdef HAVE_CONFIG_H | 35 #ifdef HAVE_CONFIG_H |
36 #include <config.h> | 36 #include <config.h> |
37 #endif | 37 #endif |
38 | 38 |
39 #if defined (__cplusplus) || (defined (__STDC__) && __STDC__) | 39 #if defined __cplusplus || (defined (__STDC__) && __STDC__) || defined STDC_HEADERS |
40 #undef PP | 40 #undef PP |
41 #define PP(args) args | 41 #define PP(args) args |
42 #undef __ptr_t | 42 #undef __ptr_t |
43 #define __ptr_t void * | 43 #define __ptr_t void * |
44 #else /* Not C++ or ANSI C. */ | 44 #else /* Not C++ or ANSI C. */ |
45 #undef PP | 45 #undef PP |
46 #define PP(args) () | 46 #define PP(args) () |
47 #ifndef HAVE_CONFIG_H | |
48 #undef const | |
49 #define const | |
50 #endif | |
51 #undef __ptr_t | 47 #undef __ptr_t |
52 #define __ptr_t char * | 48 #define __ptr_t char * |
53 #endif /* C++ or ANSI C. */ | 49 #endif /* C++ or ANSI C. */ |
54 | 50 |
55 #if defined(_LIBC) || defined(STDC_HEADERS) || defined(USG) | 51 #if defined(_LIBC) || defined(STDC_HEADERS) || defined(USG) |
61 #ifndef memcpy | 57 #ifndef memcpy |
62 #define memcpy(d, s, n) bcopy ((s), (d), (n)) | 58 #define memcpy(d, s, n) bcopy ((s), (d), (n)) |
63 #endif | 59 #endif |
64 #endif | 60 #endif |
65 | 61 |
66 #if defined (__GNU_LIBRARY__) || (defined (__STDC__) && __STDC__) | 62 #ifdef HAVE_LIMITS_H |
67 #include <limits.h> | 63 #include <limits.h> |
68 #else | 64 #endif |
69 #ifndef CHAR_BIT | 65 #ifndef CHAR_BIT |
70 #define CHAR_BIT 8 | 66 #define CHAR_BIT 8 |
71 #endif | 67 #endif |
72 #endif | |
73 | 68 |
74 #ifdef HAVE_UNISTD_H | 69 #ifdef HAVE_UNISTD_H |
75 #include <unistd.h> | 70 #include <unistd.h> |
76 #endif | 71 #endif |
77 | 72 |
81 #ifdef __cplusplus | 76 #ifdef __cplusplus |
82 extern "C" | 77 extern "C" |
83 { | 78 { |
84 #endif | 79 #endif |
85 | 80 |
86 #if defined (__STDC__) && __STDC__ | 81 #ifdef STDC_HEADERS |
87 #include <stddef.h> | 82 #include <stddef.h> |
88 #define __malloc_size_t size_t | 83 #define __malloc_size_t size_t |
89 #define __malloc_ptrdiff_t ptrdiff_t | 84 #define __malloc_ptrdiff_t ptrdiff_t |
90 #else | 85 #else |
91 #define __malloc_size_t unsigned int | 86 #define __malloc_size_t unsigned int |
92 #define __malloc_ptrdiff_t int | 87 #define __malloc_ptrdiff_t int |
93 #endif | 88 #endif |
94 | 89 |
95 #ifndef NULL | 90 #ifndef NULL |
96 #define NULL 0 | 91 #define NULL 0 |
92 #endif | |
93 | |
94 #ifndef FREE_RETURN_TYPE | |
95 #define FREE_RETURN_TYPE void | |
97 #endif | 96 #endif |
98 | 97 |
99 | 98 |
100 /* Allocate SIZE bytes of memory. */ | 99 /* Allocate SIZE bytes of memory. */ |
101 extern __ptr_t malloc PP ((__malloc_size_t __size)); | 100 extern __ptr_t malloc PP ((__malloc_size_t __size)); |
103 in __ptr_t, making the new block SIZE bytes long. */ | 102 in __ptr_t, making the new block SIZE bytes long. */ |
104 extern __ptr_t realloc PP ((__ptr_t __ptr, __malloc_size_t __size)); | 103 extern __ptr_t realloc PP ((__ptr_t __ptr, __malloc_size_t __size)); |
105 /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ | 104 /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ |
106 extern __ptr_t calloc PP ((__malloc_size_t __nmemb, __malloc_size_t __size)); | 105 extern __ptr_t calloc PP ((__malloc_size_t __nmemb, __malloc_size_t __size)); |
107 /* Free a block allocated by `malloc', `realloc' or `calloc'. */ | 106 /* Free a block allocated by `malloc', `realloc' or `calloc'. */ |
108 extern void free PP ((__ptr_t __ptr)); | 107 extern FREE_RETURN_TYPE free PP ((__ptr_t __ptr)); |
109 | 108 |
110 /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ | 109 /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ |
111 #if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */ | 110 #if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */ |
112 extern __ptr_t memalign PP ((__malloc_size_t __alignment, | 111 extern __ptr_t memalign PP ((__malloc_size_t __alignment, |
113 __malloc_size_t __size)); | 112 __malloc_size_t __size)); |
1126 break; | 1125 break; |
1127 } | 1126 } |
1128 } | 1127 } |
1129 | 1128 |
1130 /* Return memory to the heap. */ | 1129 /* Return memory to the heap. */ |
1131 void | 1130 |
1131 FREE_RETURN_TYPE | |
1132 free (ptr) | 1132 free (ptr) |
1133 __ptr_t ptr; | 1133 __ptr_t ptr; |
1134 { | 1134 { |
1135 if (__free_hook != NULL) | 1135 if (__free_hook != NULL) |
1136 (*__free_hook) (ptr); | 1136 (*__free_hook) (ptr); |