Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] It's time_t to Party!
- Date: Wed, 07 Dec 2005 04:01:06 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: Re: [tlug] It's time_t to Party!
- References: <20051202154627.GB4348@example.com> <20051202152527.302e2f6f.jep200404@example.com> <20051203122655.GG4348@example.com> <20051203092314.3118db01.jep200404@example.com> <20051204100726.GH4348@example.com> <30ce84360512040313l351f16c4r1872cb4f6f34679e@example.com> <20051206082734.GB4319@example.com> <20051206134111.28de6309.jep200404@example.com>
- Organization: The XEmacs Project
- User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.5-b23 (daikon, linux)
>>>>> "Jim" == Jim <jep200404@example.com> writes: Jim> Unfortunately, I don't know how to say: Jim> printf("%(type_t)d...",ts.tv_sec); #if sizeof(type_t)==sizeof(long) #define TYPE_T_F "%ld" #endif printf (TYPE_T_F "...", ts.tv_sec); or something like that would work, I think. Jim> Some things are just best done in Emacs. >From XEmacs's lisp.h: /************************************************************************/ /** Definitions of basic types **/ /************************************************************************/ /* ------------- generic 8/16/32/64/128-bit integral types ------------ */ #if SIZEOF_SHORT == 2 #define INT_16_BIT short #define UINT_16_BIT unsigned short #elif SIZEOF_INT == 2 /* Bwa ha ha. As if XEmacs could actually support such systems. */ #define INT_16_BIT int #define UINT_16_BIT unsigned int #else #error Unable to find a 16-bit integral type #endif #if SIZEOF_INT == 4 #define INT_32_BIT int #define UINT_32_BIT unsigned int #define MAKE_32_BIT_UNSIGNED_CONSTANT(num) num##U #elif SIZEOF_LONG == 4 /* Bwa ha ha again. */ #define INT_32_BIT long #define UINT_32_BIT unsigned long #define MAKE_32_BIT_UNSIGNED_CONSTANT(num) num##UL #elif SIZEOF_SHORT == 4 /* And again. */ #define INT_32_BIT short #define UINT_32_BIT unsigned short #define MAKE_32_BIT_UNSIGNED_CONSTANT(num) num##U #elif 1 /* Unable to find a 32-bit integral type! */ #error What kind of strange-ass system are you running on? #endif #if SIZEOF_LONG == 8 #define INT_64_BIT long #define UINT_64_BIT unsigned long #define MAKE_64_BIT_UNSIGNED_CONSTANT(num) num##UL #elif SIZEOF_LONG_LONG == 8 #define INT_64_BIT long long #define UINT_64_BIT unsigned long long #define MAKE_64_BIT_UNSIGNED_CONSTANT(num) num##ULL /* No error otherwise; just leave undefined */ #endif #if SIZEOF_LONG_LONG == 16 #define INT_128_BIT long long #define UINT_128_BIT unsigned long long #define MAKE_128_BIT_UNSIGNED_CONSTANT(num) num##ULL /* No error otherwise; just leave undefined */ #endif /* #### Fill this in for other systems */ #if defined (INT_64_BIT) && !(defined (i386) || defined (__i386__)) #define EFFICIENT_INT_64_BIT INT_64_BIT #define EFFICIENT_UINT_64_BIT UINT_64_BIT #endif #if defined (INT_128_BIT) #define EFFICIENT_INT_128_BIT INT_128_BIT #define EFFICIENT_UINT_128_BIT UINT_128_BIT #endif #ifdef HAVE_INTTYPES_H #include <inttypes.h> #elif defined (HAVE_INTPTR_T_IN_SYS_TYPES_H) /* included elsewhere */ #elif SIZEOF_VOID_P == SIZEOF_INT typedef int intptr_t; typedef unsigned int uintptr_t; #elif SIZEOF_VOID_P == SIZEOF_LONG typedef long intptr_t; typedef unsigned long uintptr_t; #elif defined (SIZEOF_LONG_LONG) && SIZEOF_VOID_P == SIZEOF_LONG_LONG typedef long long intptr_t; typedef unsigned long long uintptr_t; #else /* Just pray. May break, may not. */ typedef long intptr_t; typedef unsigned long uintptr_t; #endif -- School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.
- Follow-Ups:
- Re: [tlug] It's time_t to Party!
- From: Jim
- References:
- [tlug] timing for geeks :)
- From: Michal Hajek
- Re: [tlug] timing for geeks
- From: Jim
- Re: [tlug] timing for geeks
- From: Michal Hajek
- Re: [tlug] A Rich Experiment Indeed
- From: Jim
- Re: [tlug] A Rich Experiment Indeed
- From: Michal Hajek
- Re: [tlug] A Rich Experiment Indeed
- From: Ian Wells
- Re: [tlug] timing for geeks II.
- From: Michal Hajek
- Re: [tlug] It's time_t to Party!
- From: Jim
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] It's time_t to Party!
- Next by Date: Re: [tlug] It's time_t to Party!
- Previous by thread: Re: [tlug] It's time_t to Party!
- Next by thread: Re: [tlug] It's time_t to Party!
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links