chromium/third_party/ots/src/include/opentype-sanitiser.h

// Copyright (c) 2009-2017 The OTS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef OPENTYPE_SANITISER_H_
#define OPENTYPE_SANITISER_H_

#if defined(_WIN32)
#include <stdlib.h>
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#define ots_ntohl
#define ots_ntohs
#define ots_htonl
#define ots_htons
#else
#include <arpa/inet.h>
#include <stdint.h>
#define ots_ntohl(x)
#define ots_ntohs(x)
#define ots_htonl(x)
#define ots_htons(x)
#endif

#include <sys/types.h>

#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstring>

#define OTS_TAG(c1,c2,c3,c4)
#define OTS_UNTAG(tag)

#if defined(__GNUC__) && (__GNUC__ >= 4) || (__clang__)
#define OTS_UNUSED
#elif defined(_MSC_VER)
#define OTS_UNUSED
#else
#define OTS_UNUSED
#endif

namespace ots {

// -----------------------------------------------------------------------------
// This is an interface for an abstract stream class which is used for writing
// the serialised results out.
// -----------------------------------------------------------------------------
class OTSStream {};

#ifdef __GCC__
#define MSGFUNC_FMT_ATTR
#else
#define MSGFUNC_FMT_ATTR
#endif

enum TableAction {};

class OTSContext {};

}  // namespace ots

#endif  // OPENTYPE_SANITISER_H_