apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/misc/win32 getuuid.c
Date Tue, 12 Feb 2002 21:56:13 GMT
wrowe       02/02/12 13:56:13

  Modified:    misc/unix errorcodes.c
               misc/win32 getuuid.c
  Log:
    We can't use strerror() or CoCreateGuid() on WinCE.
    Submitted by Mladen Turk <mturk@mappingsoft.com>
  
  Revision  Changes    Path
  1.47      +6 -0      apr/misc/unix/errorcodes.c
  
  Index: errorcodes.c
  ===================================================================
  RCS file: /home/cvs/apr/misc/unix/errorcodes.c,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- errorcodes.c	14 Dec 2001 00:15:50 -0000	1.46
  +++ errorcodes.c	12 Feb 2002 21:56:13 -0000	1.47
  @@ -393,7 +393,13 @@
   static char *native_strerror(apr_status_t statcode, char *buf,
                                apr_size_t bufsize)
   {
  +#ifdef _WIN32_WCE
  +    static char err[32];
  +    sprintf(err, "Native Error #%d", statcode);
  +    return stuffbuffer(buf, bufsize, err);
  +#else
       return stuffbuffer(buf, bufsize, strerror(statcode));
  +#endif
   }
   #endif
   
  
  
  
  1.7       +10 -0     apr/misc/win32/getuuid.c
  
  Index: getuuid.c
  ===================================================================
  RCS file: /home/cvs/apr/misc/win32/getuuid.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- getuuid.c	13 Apr 2001 15:31:31 -0000	1.6
  +++ getuuid.c	12 Feb 2002 21:56:13 -0000	1.7
  @@ -76,6 +76,16 @@
        * is therefore not only a uniqifier, but an identity (which might not
        * be appropriate in all cases.
        */
  +#ifndef _WIN32_WCE
       (void) CoCreateGuid(&guid);
  +#else
  +    /* WCE lacks CoCreateGuid. So make something simple
  +     * for now.
  +     */ 
  +    guid.Data1 = rand();
  +    guid.Data2 = rand();
  +    guid.Data3 = rand();
  +    sprintf(guid.Data4, "%08X", rand());
  +#endif
       memcpy(uuid->data, &guid, sizeof(uuid->data));
   }
  
  
  

Mime
View raw message