On Mon, 25 Jul 2005, Jeff Woods wrote:

At 7/25/2005 08:47 +0000, Holger Kiehl wrote:
I would like to have an unsigned off_t, what is the best and portable way to define this? Currently I use the following code:

   #if SIZEOF_OFF_T == 4
   typedef unsigned long       u_off_t;
   #else
   typedef unsigned long long  u_off_t;
   #endif

SIZEOF_OFF_T is returned from the gnu autoconfig tools.

Is this the correct way of doing this? Or is there some better more portable way?

Does the following do what you want?

       typedef unsigned off_t u_off_t;

No, this is what I tried first but does not compile. Try the following code:

   #include <stdio.h>
   #include <sys/types.h>

   typedef unsigned off_t u_off_t;

   int
   main(void)
   {
      u_off_t a;

      return 0;
   }

Thanks,
Holger

-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" 
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to