Fix failure to compile on Windows due to 2012-07-27T06:04:35Z!dmantipov@yandex.ru.
[bpt/emacs.git] / src / alloc.c
index 3d8b7a5..27426cd 100644 (file)
@@ -2813,7 +2813,7 @@ list5 (Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4, L
 
 /* Make a list of COUNT Lisp_Objects, where ARG is the
    first one.  Allocate conses from pure space if TYPE
-   is PURE, or allocate as usual if type is HEAP.  */
+   is CONSTYPE_PURE, or allocate as usual if type is CONSTYPE_HEAP.  */
 
 Lisp_Object
 listn (enum constype type, ptrdiff_t count, Lisp_Object arg, ...)
@@ -2834,9 +2834,9 @@ listn (enum constype type, ptrdiff_t count, Lisp_Object arg, ...)
 
   for (i = 0, val = Qnil; i < count; i++)
     {
-      if (type == PURE)
+      if (type == CONSTYPE_PURE)
        val = pure_cons (objp[i], val);
-      else if (type == HEAP)
+      else if (type == CONSTYPE_HEAP)
        val = Fcons (objp[i], val);
       else
        abort ();
@@ -3685,10 +3685,17 @@ DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0,
        doc: /* Return a newly allocated marker which does not point at any place.  */)
   (void)
 {
-  register Lisp_Object marker = allocate_misc (Lisp_Misc_Marker);
+  register Lisp_Object val;
+  register struct Lisp_Marker *p;
 
-  init_marker (XMARKER (marker), NULL, 0, 0, 0);
-  return marker;
+  val = allocate_misc (Lisp_Misc_Marker);
+  p = XMARKER (val);
+  p->buffer = 0;
+  p->bytepos = 0;
+  p->charpos = 0;
+  p->next = NULL;
+  p->insertion_type = 0;
+  return val;
 }
 
 /* Return a newly allocated marker which points into BUF
@@ -3697,23 +3704,24 @@ DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0,
 Lisp_Object
 build_marker (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t bytepos)
 {
-  register Lisp_Object marker = allocate_misc (Lisp_Misc_Marker);
-
-  /* Use Fmake_marker to create marker points to nowhere.  */
-  eassert (buf != NULL);
+  Lisp_Object obj;
+  struct Lisp_Marker *m;
 
   /* No dead buffers here.  */
   eassert (!NILP (BVAR (buf, name)));
 
-  /* In a single-byte buffer, two positions must be equal.
-     Otherwise, every character is at least one byte.  */
-  if (BUF_Z (buf) == BUF_Z_BYTE (buf))
-    eassert (charpos == bytepos);
-  else
-    eassert (charpos <= bytepos);
-
-  init_marker (XMARKER (marker), buf, charpos, bytepos, 0);
-  return marker;
+  /* Every character is at least one byte.  */
+  eassert (charpos <= bytepos);
+
+  obj = allocate_misc (Lisp_Misc_Marker);
+  m = XMARKER (obj);
+  m->buffer = buf;
+  m->charpos = charpos;
+  m->bytepos = bytepos;
+  m->insertion_type = 0;
+  m->next = BUF_MARKERS (buf);
+  BUF_MARKERS (buf) = m;
+  return obj;
 }
 
 /* Put MARKER back on the free list after using it temporarily.  */
@@ -6081,19 +6089,6 @@ mark_object (Lisp_Object arg)
          case PVEC_SUBR:
            break;
 
-         case PVEC_EXCURSION:
-           {
-             struct Lisp_Excursion *e = (struct Lisp_Excursion *) ptr;
-             /* No Lisp_Objects but two special pointers to mark here.  */
-             eassert (e->buffer != NULL);
-             eassert (e->window != NULL);
-             if (!VECTOR_MARKED_P (e->buffer))
-               mark_buffer (e->buffer);
-             if (!VECTOR_MARKED_P (e->window))
-               mark_vectorlike ((struct Lisp_Vector *) e->window);
-           }
-           break;
-
          case PVEC_FREE:
            abort ();
 
@@ -6681,7 +6676,7 @@ Frames, windows, buffers, and subprocesses count as vectors
   (but the contents of a buffer's text do not count here).  */)
   (void)
 {
-  return listn (HEAP, 8,
+  return listn (CONSTYPE_HEAP, 8,
                bounded_number (cons_cells_consed),
                bounded_number (floats_consed),
                bounded_number (vector_cells_consed),
@@ -6870,7 +6865,7 @@ do hash-consing of the objects allocated to pure space.  */);
   /* We build this in advance because if we wait until we need it, we might
      not be able to allocate the memory to hold it.  */
   Vmemory_signal_data
-    = listn (PURE, 2, Qerror,
+    = listn (CONSTYPE_PURE, 2, Qerror,
             build_pure_c_string ("Memory exhausted--use M-x save-some-buffers then exit and restart Emacs"));
 
   DEFVAR_LISP ("memory-full", Vmemory_full,
@@ -6910,12 +6905,25 @@ The time is in seconds as a floating point value.  */);
 #endif
 }
 
-/* Make some symbols visible to GDB.  These cannot be done as enums, like
-   GCTYPEBITS or USE_LSB_TAG, since values might not be in 'int' range.
-   Each symbol X has a corresponding X_VAL symbol, verified to have
-   the correct value.
+/* Make some symbols visible to GDB.  This section is last, so that
+   the #undef lines don't mess up later code.  */
+
+/* When compiled with GCC, GDB might say "No enum type named
+   pvec_type" if we don't have at least one symbol with that type, and
+   then xbacktrace could fail.  Similarly for the other enums and
+   their values.  */
+union
+{
+  enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE;
+  enum enum_USE_LSB_TAG enum_USE_LSB_TAG;
+  enum Lisp_Bits Lisp_Bits;
+  enum More_Lisp_Bits More_Lisp_Bits;
+  enum pvec_type pvec_type;
+} const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0};
 
-   This is last, so that the #undef lines don't mess up later code.  */
+/* These symbols cannot be done as enums, since values might not be
+   in 'int' range.  Each symbol X has a corresponding X_VAL symbol,
+   verified to have the correct value.  */
 
 #define ARRAY_MARK_FLAG_VAL PTRDIFF_MIN
 #define PSEUDOVECTOR_FLAG_VAL (PTRDIFF_MAX - PTRDIFF_MAX / 2)