gfx/ots/ots-visibility.patch

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/ots/ots-visibility.patch	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,88 @@
     1.4 +diff --git a/gfx/ots/include/opentype-sanitiser.h b/gfx/ots/include/opentype-sanitiser.h
     1.5 +--- a/gfx/ots/include/opentype-sanitiser.h
     1.6 ++++ b/gfx/ots/include/opentype-sanitiser.h
     1.7 +@@ -1,15 +1,35 @@
     1.8 + // Copyright (c) 2009 The Chromium Authors. All rights reserved.
     1.9 + // Use of this source code is governed by a BSD-style license that can be
    1.10 + // found in the LICENSE file.
    1.11 + 
    1.12 + #ifndef OPENTYPE_SANITISER_H_
    1.13 + #define OPENTYPE_SANITISER_H_
    1.14 + 
    1.15 ++#if defined(_WIN32) || defined(__CYGWIN__)
    1.16 ++  #define OTS_DLL_IMPORT __declspec(dllimport)
    1.17 ++  #define OTS_DLL_EXPORT __declspec(dllexport)
    1.18 ++#else
    1.19 ++  #if __GNUC__ >= 4
    1.20 ++    #define OTS_DLL_IMPORT __attribute__((visibility ("default")))
    1.21 ++    #define OTS_DLL_EXPORT __attribute__((visibility ("default")))
    1.22 ++  #endif
    1.23 ++#endif
    1.24 ++
    1.25 ++#ifdef OTS_DLL
    1.26 ++  #ifdef OTS_DLL_EXPORTS
    1.27 ++    #define OTS_API OTS_DLL_EXPORT
    1.28 ++  #else
    1.29 ++    #define OTS_API OTS_DLL_IMPORT
    1.30 ++  #endif
    1.31 ++#else
    1.32 ++  #define OTS_API
    1.33 ++#endif
    1.34 ++
    1.35 + #if defined(_WIN32)
    1.36 + #include <stdlib.h>
    1.37 + typedef signed char int8_t;
    1.38 + typedef unsigned char uint8_t;
    1.39 + typedef short int16_t;
    1.40 + typedef unsigned short uint16_t;
    1.41 + typedef int int32_t;
    1.42 + typedef unsigned int uint32_t;
    1.43 +@@ -182,45 +202,45 @@ class OTSStream {
    1.44 + // -----------------------------------------------------------------------------
    1.45 + // Process a given OpenType file and write out a sanitised version
    1.46 + //   output: a pointer to an object implementing the OTSStream interface. The
    1.47 + //     sanitisied output will be written to this. In the even of a failure,
    1.48 + //     partial output may have been written.
    1.49 + //   input: the OpenType file
    1.50 + //   length: the size, in bytes, of |input|
    1.51 + // -----------------------------------------------------------------------------
    1.52 +-bool Process(OTSStream *output, const uint8_t *input, size_t length);
    1.53 ++bool OTS_API Process(OTSStream *output, const uint8_t *input, size_t length);
    1.54 + 
    1.55 + // Signature of the function to be provided by the client in order to report errors.
    1.56 + // The return type is a boolean so that it can be used within an expression,
    1.57 + // but the actual value is ignored. (Suggested convention is to always return 'false'.)
    1.58 + #ifdef __GCC__
    1.59 + #define MSGFUNC_FMT_ATTR __attribute__((format(printf, 2, 3)))
    1.60 + #else
    1.61 + #define MSGFUNC_FMT_ATTR
    1.62 + #endif
    1.63 + typedef bool (*MessageFunc)(void *user_data, const char *format, ...)  MSGFUNC_FMT_ATTR;
    1.64 + 
    1.65 + // Set a callback function that will be called when OTS is reporting an error.
    1.66 +-void SetMessageCallback(MessageFunc func, void *user_data);
    1.67 ++void OTS_API SetMessageCallback(MessageFunc func, void *user_data);
    1.68 + 
    1.69 + enum TableAction {
    1.70 +   TABLE_ACTION_DEFAULT,  // Use OTS's default action for that table
    1.71 +   TABLE_ACTION_SANITIZE, // Sanitize the table, potentially droping it
    1.72 +   TABLE_ACTION_PASSTHRU, // Serialize the table unchanged
    1.73 +   TABLE_ACTION_DROP      // Drop the table
    1.74 + };
    1.75 + 
    1.76 + // Signature of the function to be provided by the client to decide what action
    1.77 + // to do for a given table.
    1.78 + typedef TableAction (*TableActionFunc)(uint32_t tag, void *user_data);
    1.79 + 
    1.80 + // Set a callback function that will be called when OTS needs to decide what to
    1.81 + // do for a font table.
    1.82 +-void SetTableActionCallback(TableActionFunc func, void *user_data);
    1.83 ++void OTS_API SetTableActionCallback(TableActionFunc func, void *user_data);
    1.84 + 
    1.85 + // Force to disable debug output even when the library is compiled with
    1.86 + // -DOTS_DEBUG.
    1.87 + void DisableDebugOutput();
    1.88 + 
    1.89 + // Enable WOFF2 support(experimental).
    1.90 + void EnableWOFF2();
    1.91 + 

mercurial