Ticket #26655: patch-configure.ac.diff

File patch-configure.ac.diff, 8.2 KB (added by dbevans (David B. Evans), 14 years ago)

Required patchfile updated from glib-devel

  • configure.ac

    old new  
    29892989        cat >>$outfile <<_______EOF
    29902990#define G_HAVE_GINT64 1          /* deprecated, always true */
    29912991
    2992 ${glib_extension}typedef signed $gint64 gint64;
    2993 ${glib_extension}typedef unsigned $gint64 guint64;
     2992#ifdef __LP64__
     2993${glib_extension}typedef signed long gint64;
     2994${glib_extension}typedef unsigned long guint64;
    29942995
    2995 #define G_GINT64_CONSTANT(val)  $gint64_constant
    2996 #define G_GUINT64_CONSTANT(val) $guint64_constant
     2996#define G_GINT64_CONSTANT(val)  (val##L)
     2997#define G_GUINT64_CONSTANT(val) (val##UL)
     2998#else
     2999${glib_extension}typedef signed long long gint64;
     3000${glib_extension}typedef unsigned long long guint64;
     3001
     3002#define G_GINT64_CONSTANT(val)  (G_GNUC_EXTENSION (val##LL))
     3003#define G_GUINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##ULL))
     3004#endif
    29973005_______EOF
    29983006
    29993007        if test x$gint64_format != x ; then
    30003008          cat >>$outfile <<_______EOF
    3001 #define G_GINT64_MODIFIER $gint64_modifier
    3002 #define G_GINT64_FORMAT $gint64_format
    3003 #define G_GUINT64_FORMAT $guint64_format
     3009#ifdef __LP64__
     3010#define G_GINT64_MODIFIER "l"
     3011#define G_GINT64_FORMAT "li"
     3012#define G_GUINT64_FORMAT "lu"
     3013#else
     3014#define G_GINT64_MODIFIER "ll"
     3015#define G_GINT64_FORMAT "lli"
     3016#define G_GUINT64_FORMAT "llu"
     3017#endif
    30043018_______EOF
    30053019        else
    30063020          cat >>$outfile <<_______EOF
     
    30123026
    30133027        cat >>$outfile <<_______EOF
    30143028
    3015 #define GLIB_SIZEOF_VOID_P $glib_void_p
    3016 #define GLIB_SIZEOF_LONG   $glib_long
    3017 #define GLIB_SIZEOF_SIZE_T $glib_size_t
     3029#ifdef __LP64__
     3030#define GLIB_SIZEOF_VOID_P 8
     3031#define GLIB_SIZEOF_LONG   8
     3032#define GLIB_SIZEOF_SIZE_T 8
     3033#else
     3034#define GLIB_SIZEOF_VOID_P 4
     3035#define GLIB_SIZEOF_LONG   4
     3036#define GLIB_SIZEOF_SIZE_T 4
     3037#endif
    30183038
    30193039_______EOF
    30203040
     
    30423062        if test -z "$glib_unknown_void_p"; then
    30433063          cat >>$outfile <<_______EOF
    30443064
    3045 #define GPOINTER_TO_INT(p)      ((gint)  ${glib_gpi_cast} (p))
    3046 #define GPOINTER_TO_UINT(p)     ((guint) ${glib_gpui_cast} (p))
     3065#ifdef __LP64__
     3066#define GPOINTER_TO_INT(p)      ((gint)  (glong) (p))
     3067#define GPOINTER_TO_UINT(p)     ((guint) (gulong) (p))
     3068
     3069#define GINT_TO_POINTER(i)      ((gpointer) (glong) (i))
     3070#define GUINT_TO_POINTER(u)     ((gpointer) (gulong) (u))
     3071
     3072typedef signed long gintptr;
     3073typedef unsigned long guintptr;
     3074
     3075#define G_GINTPTR_MODIFIER      "l"
     3076#define G_GINTPTR_FORMAT        "li"
     3077#define G_GUINTPTR_FORMAT       "lu"
     3078#else
     3079#define GPOINTER_TO_INT(p)      ((gint)   (p))
     3080#define GPOINTER_TO_UINT(p)     ((guint)  (p))
    30473081
    3048 #define GINT_TO_POINTER(i)      ((gpointer) ${glib_gpi_cast} (i))
    3049 #define GUINT_TO_POINTER(u)     ((gpointer) ${glib_gpui_cast} (u))
     3082#define GINT_TO_POINTER(i)      ((gpointer) (i))
     3083#define GUINT_TO_POINTER(u)     ((gpointer) (u))
    30503084
    3051 typedef signed $glib_intptr_type_define gintptr;
    3052 typedef unsigned $glib_intptr_type_define guintptr;
     3085typedef signed int gintptr;
     3086typedef unsigned int guintptr;
    30533087
    3054 #define G_GINTPTR_MODIFIER      $gintptr_modifier
    3055 #define G_GINTPTR_FORMAT        $gintptr_format
    3056 #define G_GUINTPTR_FORMAT       $guintptr_format
     3088#define G_GINTPTR_MODIFIER      ""
     3089#define G_GINTPTR_FORMAT        "i"
     3090#define G_GUINTPTR_FORMAT       "u"
     3091#endif
    30573092_______EOF
    30583093        else
    30593094          echo '#error SIZEOF_VOID_P unknown - This should never happen' >>$outfile
     
    31693204{
    31703205  struct _GMutex *runtime_mutex;
    31713206  union {
    3172     char   pad[[$g_mutex_sizeof]];
     3207#ifdef __LP64__
     3208    char   pad[[64]];
     3209#else
     3210    char   pad[[44]];
     3211#endif
    31733212    double dummy_double;
    31743213    void  *dummy_pointer;
    31753214    long   dummy_long;
    31763215  } static_mutex;
    31773216};
    3178 #define G_STATIC_MUTEX_INIT     { NULL, { { $g_mutex_contents} } }
     3217#ifdef __LP64__
     3218#ifdef __BIG_ENDIAN__
     3219#define G_STATIC_MUTEX_INIT     { NULL, { { 50,-86,-85,-89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } }
     3220#else
     3221#define G_STATIC_MUTEX_INIT     { NULL, { { -89,-85,-86,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } }
     3222#endif
     3223#else
     3224#ifdef __BIG_ENDIAN__
     3225#define G_STATIC_MUTEX_INIT     { NULL, { { 50,-86,-85,-89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } }
     3226#else
     3227#define G_STATIC_MUTEX_INIT     { NULL, { { -89,-85,-86,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } }
     3228#endif
     3229#endif
    31793230#define g_static_mutex_get_mutex(mutex) \\
    31803231  (g_thread_use_default_impl ? ((GMutex*)(gpointer) ((mutex)->static_mutex.pad)) : \\
    31813232   g_static_mutex_get_mutex_impl_shortcut (&((mutex)->runtime_mutex)))
     
    31993250typedef union _GSystemThread GSystemThread;
    32003251union _GSystemThread
    32013252{
    3202   char   data[[$g_system_thread_sizeof]];
     3253#ifdef __LP64__
     3254  char   data[[8]];
     3255#else
     3256  char   data[[4]];
     3257#endif
    32033258  double dummy_double;
    32043259  void  *dummy_pointer;
    32053260  long   dummy_long;
     
    32073262_______EOF
    32083263        if test x"$g_memory_barrier_needed" != xno; then
    32093264          echo >>$outfile
     3265          echo "#ifdef __BIG_ENDIAN__" >>$outfile
    32103266          echo "#define G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 1" >>$outfile
     3267          echo "#endif" >>$outfile
    32113268        fi
    32123269
    32133270        echo >>$outfile
    32143271        g_bit_sizes="16 32 64"
    32153272        for bits in $g_bit_sizes; do
    32163273          cat >>$outfile <<_______EOF
    3217 #define GINT${bits}_TO_${g_bs_native}(val)      ((gint${bits}) (val))
    3218 #define GUINT${bits}_TO_${g_bs_native}(val)     ((guint${bits}) (val))
    3219 #define GINT${bits}_TO_${g_bs_alien}(val)       ((gint${bits}) GUINT${bits}_SWAP_LE_BE (val))
    3220 #define GUINT${bits}_TO_${g_bs_alien}(val)      (GUINT${bits}_SWAP_LE_BE (val))
     3274#ifdef __BIG_ENDIAN__
     3275#define GINT${bits}_TO_BE(val)  ((gint${bits}) (val))
     3276#define GUINT${bits}_TO_BE(val) ((guint${bits}) (val))
     3277#define GINT${bits}_TO_LE(val)  ((gint${bits}) GUINT${bits}_SWAP_LE_BE (val))
     3278#define GUINT${bits}_TO_LE(val) (GUINT${bits}_SWAP_LE_BE (val))
     3279#else
     3280#define GINT${bits}_TO_LE(val)  ((gint${bits}) (val))
     3281#define GUINT${bits}_TO_LE(val) ((guint${bits}) (val))
     3282#define GINT${bits}_TO_BE(val)  ((gint${bits}) GUINT${bits}_SWAP_LE_BE (val))
     3283#define GUINT${bits}_TO_BE(val) (GUINT${bits}_SWAP_LE_BE (val))
     3284#endif
    32213285_______EOF
    32223286        done
    32233287
    32243288        cat >>$outfile <<_______EOF
    3225 #define GLONG_TO_LE(val)        ((glong) GINT${glongbits}_TO_LE (val))
    3226 #define GULONG_TO_LE(val)       ((gulong) GUINT${glongbits}_TO_LE (val))
    3227 #define GLONG_TO_BE(val)        ((glong) GINT${glongbits}_TO_BE (val))
    3228 #define GULONG_TO_BE(val)       ((gulong) GUINT${glongbits}_TO_BE (val))
     3289#ifdef __LP64__
     3290#define GLONG_TO_LE(val)        ((glong) GINT64_TO_LE (val))
     3291#define GULONG_TO_LE(val)       ((gulong) GUINT64_TO_LE (val))
     3292#define GLONG_TO_BE(val)        ((glong) GINT64_TO_BE (val))
     3293#define GULONG_TO_BE(val)       ((gulong) GUINT64_TO_BE (val))
     3294#else
     3295#define GLONG_TO_LE(val)        ((glong) GINT32_TO_LE (val))
     3296#define GULONG_TO_LE(val)       ((gulong) GUINT32_TO_LE (val))
     3297#define GLONG_TO_BE(val)        ((glong) GINT32_TO_BE (val))
     3298#define GULONG_TO_BE(val)       ((gulong) GUINT32_TO_BE (val))
     3299#endif
    32293300#define GINT_TO_LE(val)         ((gint) GINT${gintbits}_TO_LE (val))
    32303301#define GUINT_TO_LE(val)        ((guint) GUINT${gintbits}_TO_LE (val))
    32313302#define GINT_TO_BE(val)         ((gint) GINT${gintbits}_TO_BE (val))
    32323303#define GUINT_TO_BE(val)        ((guint) GUINT${gintbits}_TO_BE (val))
    3233 #define GSIZE_TO_LE(val)        ((gsize) GUINT${gsizebits}_TO_LE (val))
    3234 #define GSSIZE_TO_LE(val)       ((gssize) GINT${gsizebits}_TO_LE (val))
    3235 #define GSIZE_TO_BE(val)        ((gsize) GUINT${gsizebits}_TO_BE (val))
    3236 #define GSSIZE_TO_BE(val)       ((gssize) GINT${gsizebits}_TO_BE (val))
    3237 #define G_BYTE_ORDER $g_byte_order
     3304#ifdef __LP64__
     3305#define GSIZE_TO_LE(val)        ((gsize) GUINT64_TO_LE (val))
     3306#define GSSIZE_TO_LE(val)       ((gssize) GINT64_TO_LE (val))
     3307#define GSIZE_TO_BE(val)        ((gsize) GUINT64_TO_BE (val))
     3308#define GSSIZE_TO_BE(val)       ((gssize) GINT64_TO_BE (val))
     3309#else
     3310#define GSIZE_TO_LE(val)        ((gsize) GUINT32_TO_LE (val))
     3311#define GSSIZE_TO_LE(val)       ((gssize) GINT32_TO_LE (val))
     3312#define GSIZE_TO_BE(val)        ((gsize) GUINT32_TO_BE (val))
     3313#define GSSIZE_TO_BE(val)       ((gssize) GINT32_TO_BE (val))
     3314#endif
     3315#ifdef __BIG_ENDIAN__
     3316#define G_BYTE_ORDER G_BIG_ENDIAN
     3317#else
     3318#define G_BYTE_ORDER G_LITTLE_ENDIAN
     3319#endif
    32383320
    32393321#define GLIB_SYSDEF_POLLIN =$g_pollin
    32403322#define GLIB_SYSDEF_POLLOUT =$g_pollout
     
    35193601*)                      glib_vacopy=''
    35203602esac
    35213603
    3522 if test x$glib_cv_va_val_copy = xno; then
    35233604  glib_vacopy="\$glib_vacopy
    3524 #define G_VA_COPY_AS_ARRAY 1"
    3525 fi
     3605#ifdef __LP64__
     3606#define G_VA_COPY_AS_ARRAY 1
     3607#endif"
    35263608
    35273609if test x$glib_cv_hasinline = xyes; then
    35283610    glib_inline='#define G_HAVE_INLINE 1'