Path: blob/master/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h
41155 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/* pngconf.h - machine-configurable file for libpng25*26* This file is available under and governed by the GNU General Public27* License version 2 only, as published by the Free Software Foundation.28* However, the following notice accompanied the original version of this29* file and, per its terms, should not be removed:30*31* libpng version 1.6.3732*33* Copyright (c) 2018-2019 Cosmin Truta34* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson35* Copyright (c) 1996-1997 Andreas Dilger36* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.37*38* This code is released under the libpng license.39* For conditions of distribution and use, see the disclaimer40* and license in png.h41*42* Any machine specific code is near the front of this file, so if you43* are configuring libpng for a machine, you may want to read the section44* starting here down to where it starts to typedef png_color, png_text,45* and png_info.46*/4748#ifndef PNGCONF_H49#define PNGCONF_H5051#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */5253/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C54* compiler for correct compilation. The following header files are required by55* the standard. If your compiler doesn't provide these header files, or they56* do not match the standard, you will need to provide/improve them.57*/58#include <limits.h>59#include <stddef.h>6061/* Library header files. These header files are all defined by ISOC90; libpng62* expects conformant implementations, however, an ISOC90 conformant system need63* not provide these header files if the functionality cannot be implemented.64* In this case it will be necessary to disable the relevant parts of libpng in65* the build of pnglibconf.h.66*67* Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not68* include this unnecessary header file.69*/7071#ifdef PNG_STDIO_SUPPORTED72/* Required for the definition of FILE: */73# include <stdio.h>74#endif7576#ifdef PNG_SETJMP_SUPPORTED77/* Required for the definition of jmp_buf and the declaration of longjmp: */78# include <setjmp.h>79#endif8081#ifdef PNG_CONVERT_tIME_SUPPORTED82/* Required for struct tm: */83# include <time.h>84#endif8586#endif /* PNG_BUILDING_SYMBOL_TABLE */8788/* Prior to 1.6.0, it was possible to turn off 'const' in declarations,89* using PNG_NO_CONST. This is no longer supported.90*/91#define PNG_CONST const /* backward compatibility only */9293/* This controls optimization of the reading of 16-bit and 32-bit94* values from PNG files. It can be set on a per-app-file basis: it95* just changes whether a macro is used when the function is called.96* The library builder sets the default; if read functions are not97* built into the library the macro implementation is forced on.98*/99#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED100# define PNG_USE_READ_MACROS101#endif102#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)103# if PNG_DEFAULT_READ_MACROS104# define PNG_USE_READ_MACROS105# endif106#endif107108/* COMPILER SPECIFIC OPTIONS.109*110* These options are provided so that a variety of difficult compilers111* can be used. Some are fixed at build time (e.g. PNG_API_RULE112* below) but still have compiler specific implementations, others113* may be changed on a per-file basis when compiling against libpng.114*/115116/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect117* against legacy (pre ISOC90) compilers that did not understand function118* prototypes. It is not required for modern C compilers.119*/120#ifndef PNGARG121# define PNGARG(arglist) arglist122#endif123124/* Function calling conventions.125* =============================126* Normally it is not necessary to specify to the compiler how to call127* a function - it just does it - however on x86 systems derived from128* Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems129* and some others) there are multiple ways to call a function and the130* default can be changed on the compiler command line. For this reason131* libpng specifies the calling convention of every exported function and132* every function called via a user supplied function pointer. This is133* done in this file by defining the following macros:134*135* PNGAPI Calling convention for exported functions.136* PNGCBAPI Calling convention for user provided (callback) functions.137* PNGCAPI Calling convention used by the ANSI-C library (required138* for longjmp callbacks and sometimes used internally to139* specify the calling convention for zlib).140*141* These macros should never be overridden. If it is necessary to142* change calling convention in a private build this can be done143* by setting PNG_API_RULE (which defaults to 0) to one of the values144* below to select the correct 'API' variants.145*146* PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.147* This is correct in every known environment.148* PNG_API_RULE=1 Use the operating system convention for PNGAPI and149* the 'C' calling convention (from PNGCAPI) for150* callbacks (PNGCBAPI). This is no longer required151* in any known environment - if it has to be used152* please post an explanation of the problem to the153* libpng mailing list.154*155* These cases only differ if the operating system does not use the C156* calling convention, at present this just means the above cases157* (x86 DOS/Windows systems) and, even then, this does not apply to158* Cygwin running on those systems.159*160* Note that the value must be defined in pnglibconf.h so that what161* the application uses to call the library matches the conventions162* set when building the library.163*/164165/* Symbol export166* =============167* When building a shared library it is almost always necessary to tell168* the compiler which symbols to export. The png.h macro 'PNG_EXPORT'169* is used to mark the symbols. On some systems these symbols can be170* extracted at link time and need no special processing by the compiler,171* on other systems the symbols are flagged by the compiler and just172* the declaration requires a special tag applied (unfortunately) in a173* compiler dependent way. Some systems can do either.174*175* A small number of older systems also require a symbol from a DLL to176* be flagged to the program that calls it. This is a problem because177* we do not know in the header file included by application code that178* the symbol will come from a shared library, as opposed to a statically179* linked one. For this reason the application must tell us by setting180* the magic flag PNG_USE_DLL to turn on the special processing before181* it includes png.h.182*183* Four additional macros are used to make this happen:184*185* PNG_IMPEXP The magic (if any) to cause a symbol to be exported from186* the build or imported if PNG_USE_DLL is set - compiler187* and system specific.188*189* PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to190* 'type', compiler specific.191*192* PNG_DLL_EXPORT Set to the magic to use during a libpng build to193* make a symbol exported from the DLL. Not used in the194* public header files; see pngpriv.h for how it is used195* in the libpng build.196*197* PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come198* from a DLL - used to define PNG_IMPEXP when199* PNG_USE_DLL is set.200*/201202/* System specific discovery.203* ==========================204* This code is used at build time to find PNG_IMPEXP, the API settings205* and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL206* import processing is possible. On Windows systems it also sets207* compiler-specific macros to the values required to change the calling208* conventions of the various functions.209*/210#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\211defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)212/* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or213* MinGW on any architecture currently supported by Windows. Also includes214* Watcom builds but these need special treatment because they are not215* compatible with GCC or Visual C because of different calling conventions.216*/217# if PNG_API_RULE == 2218/* If this line results in an error, either because __watcall is not219* understood or because of a redefine just below you cannot use *this*220* build of the library with the compiler you are using. *This* build was221* build using Watcom and applications must also be built using Watcom!222*/223# define PNGCAPI __watcall224# endif225226# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))227# define PNGCAPI __cdecl228# if PNG_API_RULE == 1229/* If this line results in an error __stdcall is not understood and230* PNG_API_RULE should not have been set to '1'.231*/232# define PNGAPI __stdcall233# endif234# else235/* An older compiler, or one not detected (erroneously) above,236* if necessary override on the command line to get the correct237* variants for the compiler.238*/239# ifndef PNGCAPI240# define PNGCAPI _cdecl241# endif242# if PNG_API_RULE == 1 && !defined(PNGAPI)243# define PNGAPI _stdcall244# endif245# endif /* compiler/api */246247/* NOTE: PNGCBAPI always defaults to PNGCAPI. */248249# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)250# error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"251# endif252253# if (defined(_MSC_VER) && _MSC_VER < 800) ||\254(defined(__BORLANDC__) && __BORLANDC__ < 0x500)255/* older Borland and MSC256* compilers used '__export' and required this to be after257* the type.258*/259# ifndef PNG_EXPORT_TYPE260# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP261# endif262# define PNG_DLL_EXPORT __export263# else /* newer compiler */264# define PNG_DLL_EXPORT __declspec(dllexport)265# ifndef PNG_DLL_IMPORT266# define PNG_DLL_IMPORT __declspec(dllimport)267# endif268# endif /* compiler */269270#else /* !Windows */271# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)272# define PNGAPI _System273# else /* !Windows/x86 && !OS/2 */274/* Use the defaults, or define PNG*API on the command line (but275* this will have to be done for every compile!)276*/277# endif /* other system, !OS/2 */278#endif /* !Windows/x86 */279280/* Now do all the defaulting . */281#ifndef PNGCAPI282# define PNGCAPI283#endif284#ifndef PNGCBAPI285# define PNGCBAPI PNGCAPI286#endif287#ifndef PNGAPI288# define PNGAPI PNGCAPI289#endif290291/* PNG_IMPEXP may be set on the compilation system command line or (if not set)292* then in an internal header file when building the library, otherwise (when293* using the library) it is set here.294*/295#ifndef PNG_IMPEXP296# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)297/* This forces use of a DLL, disallowing static linking */298# define PNG_IMPEXP PNG_DLL_IMPORT299# endif300301# ifndef PNG_IMPEXP302# define PNG_IMPEXP303# endif304#endif305306/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat307* 'attributes' as a storage class - the attributes go at the start of the308* function definition, and attributes are always appended regardless of the309* compiler. This considerably simplifies these macros but may cause problems310* if any compilers both need function attributes and fail to handle them as311* a storage class (this is unlikely.)312*/313#ifndef PNG_FUNCTION314# define PNG_FUNCTION(type, name, args, attributes) attributes type name args315#endif316317#ifndef PNG_EXPORT_TYPE318# define PNG_EXPORT_TYPE(type) PNG_IMPEXP type319#endif320321/* The ordinal value is only relevant when preprocessing png.h for symbol322* table entries, so we discard it here. See the .dfn files in the323* scripts directory.324*/325326#ifndef PNG_EXPORTA327# define PNG_EXPORTA(ordinal, type, name, args, attributes) \328PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), PNGARG(args), \329PNG_LINKAGE_API attributes)330#endif331332/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,333* so make something non-empty to satisfy the requirement:334*/335#define PNG_EMPTY /*empty list*/336337#define PNG_EXPORT(ordinal, type, name, args) \338PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)339340/* Use PNG_REMOVED to comment out a removed interface. */341#ifndef PNG_REMOVED342# define PNG_REMOVED(ordinal, type, name, args, attributes)343#endif344345#ifndef PNG_CALLBACK346# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)347#endif348349/* Support for compiler specific function attributes. These are used350* so that where compiler support is available incorrect use of API351* functions in png.h will generate compiler warnings.352*353* Added at libpng-1.2.41.354*/355356#ifndef PNG_NO_PEDANTIC_WARNINGS357# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED358# define PNG_PEDANTIC_WARNINGS_SUPPORTED359# endif360#endif361362#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED363/* Support for compiler specific function attributes. These are used364* so that where compiler support is available, incorrect use of API365* functions in png.h will generate compiler warnings. Added at libpng366* version 1.2.41. Disabling these removes the warnings but may also produce367* less efficient code.368*/369# if defined(__clang__) && defined(__has_attribute)370/* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */371# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)372# define PNG_USE_RESULT __attribute__((__warn_unused_result__))373# endif374# if !defined(PNG_NORETURN) && __has_attribute(__noreturn__)375# define PNG_NORETURN __attribute__((__noreturn__))376# endif377# if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__)378# define PNG_ALLOCATED __attribute__((__malloc__))379# endif380# if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__)381# define PNG_DEPRECATED __attribute__((__deprecated__))382# endif383# if !defined(PNG_PRIVATE)384# ifdef __has_extension385# if __has_extension(attribute_unavailable_with_message)386# define PNG_PRIVATE __attribute__((__unavailable__(\387"This function is not exported by libpng.")))388# endif389# endif390# endif391# ifndef PNG_RESTRICT392# define PNG_RESTRICT __restrict393# endif394395# elif defined(__GNUC__)396# ifndef PNG_USE_RESULT397# define PNG_USE_RESULT __attribute__((__warn_unused_result__))398# endif399# ifndef PNG_NORETURN400# define PNG_NORETURN __attribute__((__noreturn__))401# endif402# if __GNUC__ >= 3403# ifndef PNG_ALLOCATED404# define PNG_ALLOCATED __attribute__((__malloc__))405# endif406# ifndef PNG_DEPRECATED407# define PNG_DEPRECATED __attribute__((__deprecated__))408# endif409# ifndef PNG_PRIVATE410# if 0 /* Doesn't work so we use deprecated instead*/411# define PNG_PRIVATE \412__attribute__((warning("This function is not exported by libpng.")))413# else414# define PNG_PRIVATE \415__attribute__((__deprecated__))416# endif417# endif418# if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))419# ifndef PNG_RESTRICT420# define PNG_RESTRICT __restrict421# endif422# endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */423# endif /* __GNUC__ >= 3 */424425# elif defined(_MSC_VER) && (_MSC_VER >= 1300)426# ifndef PNG_USE_RESULT427# define PNG_USE_RESULT /* not supported */428# endif429# ifndef PNG_NORETURN430# define PNG_NORETURN __declspec(noreturn)431# endif432# ifndef PNG_ALLOCATED433# if (_MSC_VER >= 1400)434# define PNG_ALLOCATED __declspec(restrict)435# endif436# endif437# ifndef PNG_DEPRECATED438# define PNG_DEPRECATED __declspec(deprecated)439# endif440# ifndef PNG_PRIVATE441# define PNG_PRIVATE __declspec(deprecated)442# endif443# ifndef PNG_RESTRICT444# if (_MSC_VER >= 1400)445# define PNG_RESTRICT __restrict446# endif447# endif448449# elif defined(__WATCOMC__)450# ifndef PNG_RESTRICT451# define PNG_RESTRICT __restrict452# endif453# endif454#endif /* PNG_PEDANTIC_WARNINGS */455456#ifndef PNG_DEPRECATED457# define PNG_DEPRECATED /* Use of this function is deprecated */458#endif459#ifndef PNG_USE_RESULT460# define PNG_USE_RESULT /* The result of this function must be checked */461#endif462#ifndef PNG_NORETURN463# define PNG_NORETURN /* This function does not return */464#endif465#ifndef PNG_ALLOCATED466# define PNG_ALLOCATED /* The result of the function is new memory */467#endif468#ifndef PNG_PRIVATE469# define PNG_PRIVATE /* This is a private libpng function */470#endif471#ifndef PNG_RESTRICT472# define PNG_RESTRICT /* The C99 "restrict" feature */473#endif474475#ifndef PNG_FP_EXPORT /* A floating point API. */476# ifdef PNG_FLOATING_POINT_SUPPORTED477# define PNG_FP_EXPORT(ordinal, type, name, args)\478PNG_EXPORT(ordinal, type, name, args);479# else /* No floating point APIs */480# define PNG_FP_EXPORT(ordinal, type, name, args)481# endif482#endif483#ifndef PNG_FIXED_EXPORT /* A fixed point API. */484# ifdef PNG_FIXED_POINT_SUPPORTED485# define PNG_FIXED_EXPORT(ordinal, type, name, args)\486PNG_EXPORT(ordinal, type, name, args);487# else /* No fixed point APIs */488# define PNG_FIXED_EXPORT(ordinal, type, name, args)489# endif490#endif491492#ifndef PNG_BUILDING_SYMBOL_TABLE493/* Some typedefs to get us started. These should be safe on most of the common494* platforms.495*496* png_uint_32 and png_int_32 may, currently, be larger than required to hold a497* 32-bit value however this is not normally advisable.498*499* png_uint_16 and png_int_16 should always be two bytes in size - this is500* verified at library build time.501*502* png_byte must always be one byte in size.503*504* The checks below use constants from limits.h, as defined by the ISOC90505* standard.506*/507#if CHAR_BIT == 8 && UCHAR_MAX == 255508typedef unsigned char png_byte;509#else510# error "libpng requires 8-bit bytes"511#endif512513#if INT_MIN == -32768 && INT_MAX == 32767514typedef int png_int_16;515#elif SHRT_MIN == -32768 && SHRT_MAX == 32767516typedef short png_int_16;517#else518# error "libpng requires a signed 16-bit type"519#endif520521#if UINT_MAX == 65535522typedef unsigned int png_uint_16;523#elif USHRT_MAX == 65535524typedef unsigned short png_uint_16;525#else526# error "libpng requires an unsigned 16-bit type"527#endif528529#if INT_MIN < -2147483646 && INT_MAX > 2147483646530typedef int png_int_32;531#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646532typedef long int png_int_32;533#else534# error "libpng requires a signed 32-bit (or more) type"535#endif536537#if UINT_MAX > 4294967294U538typedef unsigned int png_uint_32;539#elif ULONG_MAX > 4294967294U540typedef unsigned long int png_uint_32;541#else542# error "libpng requires an unsigned 32-bit (or more) type"543#endif544545/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.546* From 1.6.0 onwards, an ISO C90 compiler, as well as a standard-compliant547* behavior of sizeof and ptrdiff_t are required.548* The legacy typedefs are provided here for backwards compatibility.549*/550typedef size_t png_size_t;551typedef ptrdiff_t png_ptrdiff_t;552553/* libpng needs to know the maximum value of 'size_t' and this controls the554* definition of png_alloc_size_t, below. This maximum value of size_t limits555* but does not control the maximum allocations the library makes - there is556* direct application control of this through png_set_user_limits().557*/558#ifndef PNG_SMALL_SIZE_T559/* Compiler specific tests for systems where size_t is known to be less than560* 32 bits (some of these systems may no longer work because of the lack of561* 'far' support; see above.)562*/563# if (defined(__TURBOC__) && !defined(__FLAT__)) ||\564(defined(_MSC_VER) && defined(MAXSEG_64K))565# define PNG_SMALL_SIZE_T566# endif567#endif568569/* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller570* than png_uint_32. Casts from size_t or png_uint_32 to png_alloc_size_t are571* not necessary; in fact, it is recommended not to use them at all, so that572* the compiler can complain when something turns out to be problematic.573*574* Casts in the other direction (from png_alloc_size_t to size_t or575* png_uint_32) should be explicitly applied; however, we do not expect to576* encounter practical situations that require such conversions.577*578* PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than579* 4294967295 - i.e. less than the maximum value of png_uint_32.580*/581#ifdef PNG_SMALL_SIZE_T582typedef png_uint_32 png_alloc_size_t;583#else584typedef size_t png_alloc_size_t;585#endif586587/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler588* implementations of Intel CPU specific support of user-mode segmented address589* spaces, where 16-bit pointers address more than 65536 bytes of memory using590* separate 'segment' registers. The implementation requires two different591* types of pointer (only one of which includes the segment value.)592*593* If required this support is available in version 1.2 of libpng and may be594* available in versions through 1.5, although the correctness of the code has595* not been verified recently.596*/597598/* Typedef for floating-point numbers that are converted to fixed-point with a599* multiple of 100,000, e.g., gamma600*/601typedef png_int_32 png_fixed_point;602603/* Add typedefs for pointers */604typedef void * png_voidp;605typedef const void * png_const_voidp;606typedef png_byte * png_bytep;607typedef const png_byte * png_const_bytep;608typedef png_uint_32 * png_uint_32p;609typedef const png_uint_32 * png_const_uint_32p;610typedef png_int_32 * png_int_32p;611typedef const png_int_32 * png_const_int_32p;612typedef png_uint_16 * png_uint_16p;613typedef const png_uint_16 * png_const_uint_16p;614typedef png_int_16 * png_int_16p;615typedef const png_int_16 * png_const_int_16p;616typedef char * png_charp;617typedef const char * png_const_charp;618typedef png_fixed_point * png_fixed_point_p;619typedef const png_fixed_point * png_const_fixed_point_p;620typedef size_t * png_size_tp;621typedef const size_t * png_const_size_tp;622623#ifdef PNG_STDIO_SUPPORTED624typedef FILE * png_FILE_p;625#endif626627#ifdef PNG_FLOATING_POINT_SUPPORTED628typedef double * png_doublep;629typedef const double * png_const_doublep;630#endif631632/* Pointers to pointers; i.e. arrays */633typedef png_byte * * png_bytepp;634typedef png_uint_32 * * png_uint_32pp;635typedef png_int_32 * * png_int_32pp;636typedef png_uint_16 * * png_uint_16pp;637typedef png_int_16 * * png_int_16pp;638typedef const char * * png_const_charpp;639typedef char * * png_charpp;640typedef png_fixed_point * * png_fixed_point_pp;641#ifdef PNG_FLOATING_POINT_SUPPORTED642typedef double * * png_doublepp;643#endif644645/* Pointers to pointers to pointers; i.e., pointer to array */646typedef char * * * png_charppp;647648#endif /* PNG_BUILDING_SYMBOL_TABLE */649650#endif /* PNGCONF_H */651652653