andre@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: #include "primpl.h" andre@0: andre@0: /* andre@0: * We were not including in optimized builds. On AIX this andre@0: * caused libnspr4.so to export memcpy and some binaries linked with andre@0: * libnspr4.so resolved their memcpy references with libnspr4.so. To andre@0: * be backward compatible with old libnspr4.so binaries, we do not andre@0: * include in optimized builds for AIX. (bug 200561) andre@0: */ andre@0: #if !(defined(AIX) && !defined(DEBUG)) andre@0: #include andre@0: #endif andre@0: andre@0: PRSize _pr_CopyLowBits( andre@0: void *dst, andre@0: PRSize dstlen, andre@0: void *src, andre@0: PRSize srclen ) andre@0: { andre@0: if (srclen <= dstlen) { andre@0: memcpy(dst, src, srclen); andre@0: return srclen; andre@0: } andre@0: #if defined IS_BIG_ENDIAN andre@0: memcpy(dst, (char*)src + (srclen - dstlen), dstlen); andre@0: #else andre@0: memcpy(dst, src, dstlen); andre@0: #endif andre@0: return dstlen; andre@0: } andre@0: andre@0: PR_IMPLEMENT(PRSize) PR_GetRandomNoise( andre@0: void *buf, andre@0: PRSize size andre@0: ) andre@0: { andre@0: return( _PR_MD_GET_RANDOM_NOISE( buf, size )); andre@0: } /* end PR_GetRandomNoise() */ andre@0: /* end prrng.c */