The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/libsodium/test/quirks/quirks.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 
    2 #include <stdlib.h>
    3 
    4 /* C++Builder defines a "random" macro */
    5 #undef random
    6 
    7 #ifdef __native_client__
    8 # define memset(dst, c, n) xmemset(dst, c, n)
    9 
   10 static void *
   11 xmemset(void *dst, int c, size_t n)
   12 {
   13     unsigned char *     dst_ = (unsigned char *) dst;
   14     const unsigned char c_   = (unsigned char) c;
   15     size_t              i;
   16 
   17     for (i = 0; i < n; i++) {
   18         dst_[i] = c_;
   19     }
   20     return dst;
   21 }
   22 #endif
   23 
   24 #ifdef __EMSCRIPTEN__
   25 # define strcmp(s1, s2) xstrcmp(s1, s2)
   26 
   27 static int
   28 strcmp(const char *s1, const char *s2)
   29 {
   30     while (*s1 == *s2++) {
   31         if (*s1++ == 0) {
   32             return 0;
   33         }
   34     }
   35     return *(unsigned char *) s1 - *(unsigned char *) --s2;
   36 }
   37 #endif
   38 
   39 #ifdef _WIN32
   40 static void
   41 srandom(unsigned seed)
   42 {
   43     srand(seed);
   44 }
   45 
   46 static long
   47 random(void)
   48 {
   49     return (long) rand();
   50 }
   51 #endif

Cache object: 7b09539428e1080b09b9d46d6d652c3f


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.