/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "config.h"

#if !defined(HAVE_HTONLL) && !defined(WORDS_BIGENDIAN)
uint64_t couchstore_byteswap64(uint64_t val)
{
    size_t ii;
    uint64_t ret = 0;
    for (ii = 0; ii < sizeof(uint64_t); ii++) {
        ret <<= 8;
        ret |= val & 0xff;
        val >>= 8;
    }
    return ret;
}
#endif

/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "config.h"

#if !defined(HAVE_HTONLL) && !defined(WORDS_BIGENDIAN)
uint64_t couchstore_byteswap64(uint64_t val)
{
    size_t ii;
    uint64_t ret = 0;
    for (ii = 0; ii < sizeof(uint64_t); ii++) {
        ret <<= 8;
        ret |= val & 0xff;
        val >>= 8;
    }
    return ret;
}
#elif defined(__GNUC__)
// solaris boxes contains a ntohll/htonll method, but
// it seems like the gnu linker doesn't like to use
// an archive without _any_ symbols in it ;)
int unreferenced_symbol_to_satisfy_the_linker;
#endif

Add a small hack to satisfy build with gcc on smartos64
Add a small hack to satisfy build with gcc on smartos64

Solaris boxes contains a ntohll/htonll method, but
it seems like the gnu linker doesn't like to use
an archive without _any_ symbols in it ;)

Change-Id: Id3b3ae5ad055ed50a10e8e514b8266f659fb92c3
Reviewed-on: http://review.couchbase.org/15737
Reviewed-by: Jens Alfke <21e2afd93d5ce53123476032b5dca8a79b546094@couchbase.com>
Tested-by: Jens Alfke <21e2afd93d5ce53123476032b5dca8a79b546094@couchbase.com>
