]> granicus.if.org Git - python/commitdiff
Move _PyUnicode_UTF8() and _PyUnicode_UTF8_LENGTH() outside unicodeobject.h
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 29 Sep 2011 17:31:34 +0000 (19:31 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 29 Sep 2011 17:31:34 +0000 (19:31 +0200)
Move these macros to unicodeobject.c

Include/unicodeobject.h
Objects/unicodeobject.c

index a8c3e8b83e7b4e8063ebd0b93be2f532b4762839..3e9919f714d8167d28cec3cfe0cf028af9eb47c2 100644 (file)
@@ -377,16 +377,6 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
      PyUnicode_IS_COMPACT(op) ? _PyUnicode_COMPACT_DATA(op) :   \
      _PyUnicode_NONCOMPACT_DATA(op))
 
-#define _PyUnicode_UTF8(op)                     \
-    (PyUnicode_IS_COMPACT_ASCII(op) ?           \
-     ((char*)((PyASCIIObject*)(op) + 1)) :      \
-     ((PyCompactUnicodeObject*)(op))->utf8)
-
-#define _PyUnicode_UTF8_LENGTH(op)                      \
-    (PyUnicode_IS_COMPACT_ASCII(op) ?                   \
-     ((PyASCIIObject*)(op))->length :                   \
-     ((PyCompactUnicodeObject*)(op))->utf8_length)
-
 /* Compute (index * char_size) where char_size is 2 ** (kind - 1).
 
    The index is a character index, the result is a size in bytes. */
index 395f14608c05521e4c5f6972ca97551ff1b1011e..fe0d4a5b643ac48eb333587e1852a3523b758847 100644 (file)
@@ -105,6 +105,14 @@ extern "C" {
         } \
     } while (0)
 
+#define _PyUnicode_UTF8(op)                     \
+    (PyUnicode_IS_COMPACT_ASCII(op) ?           \
+     ((char*)((PyASCIIObject*)(op) + 1)) :      \
+     ((PyCompactUnicodeObject*)(op))->utf8)
+#define _PyUnicode_UTF8_LENGTH(op)                      \
+    (PyUnicode_IS_COMPACT_ASCII(op) ?                   \
+     ((PyASCIIObject*)(op))->length :                   \
+     ((PyCompactUnicodeObject*)(op))->utf8_length)
 #define _PyUnicode_WSTR(op) (((PyASCIIObject*)(op))->wstr)
 #define _PyUnicode_WSTR_LENGTH(op) (((PyCompactUnicodeObject*)(op))->wstr_length)
 #define _PyUnicode_LENGTH(op) (((PyASCIIObject *)(op))->length)