/usr/include/minidjvu/base/0porting.h is in libminidjvu-dev 0.8.svn.2010.05.06-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | /*
* 0porting.h - a portability header
*/
/*
* "0porting" keeps several typedefs and MDJVU_FUNCTION/MDJVU_IMPLEMENT macros.
*
* To compile a native Windows DLL, you need to put "__declspec(dllexport)" before
* every exported function. To use a DLL, you have to put "__declspec(dllimport)"
* before every function prototype you use. That's why we need macros here.
*
* So, a function prototype
*
* MDJVU_FUNCTION void mdjvu_foo(void);
*
* under Windows (when compiling the library) will expand into
*
* __declspec(dllexport) void mdjvu_foo(void);
*
* and when compiling any other application - into
*
* __declspec(dllimport) void mdjvu_foo(void);
*
* Under Linux this will lead to
*
* void mdjvu_foo(void);
*
* in both cases.
*
* (Also, under C++, there will be an `extern "C"' modifier).
*/
#ifndef MDJVU_USE_TIFFIO /* kluge not to typedef twice when using tiffio.h */
#ifdef HAVE_STDINT_H
#include <stdint.h>
typedef int32_t int32;
typedef uint32_t uint32;
typedef int16_t int16;
typedef uint16_t uint16;
#else
typedef int int32;
typedef unsigned int uint32;
typedef unsigned short uint16;
typedef short int16;
#endif
#endif
#ifndef HAVE_STDINT_H
#define INT32_MAX 0x7FFFFFFF
#endif
#define MDJVU_INT32_FORMAT "%d"
#define MDJVU_INT16_FORMAT "%d"
#define MDJVU_UINT32_FORMAT "%u"
#define MDJVU_UINT16_FORMAT "%u"
/* MDJVU_FUNCTION and MDJVU_IMPLEMENT are prefixes of exported functions.
* MDJVU_FUNCTION is for declarations, MDJVU_IMPLEMENT is for implementations.
* So, it's like this:
*
* // foo.h
* MDJVU_FUNCTION mdjvu_foo(void);
*
* // foo.c
* MDJVU_IMPLEMENT mdjvu_foo(void)
* {
* ...
* }
*/
#if defined(__cplusplus)
#define MDJVU_C_EXPORT_PREFIX extern "C"
#else
#define MDJVU_C_EXPORT_PREFIX
#endif
/* This Microsoft abomination of __declspec does not exist under mingw.
*/
#define MDJVU_SUPPRESS_DECLSPEC
#if (defined(windows) || defined(WIN32)) && !defined(MDJVU_SUPPRESS_DECLSPEC)
#ifdef MINIDJVU_INCLUDED_FROM_INSIDE
#define MDJVU_FUNCTION MDJVU_C_EXPORT_PREFIX __declspec(dllexport)
#define MDJVU_IMPLEMENT __declspec(dllexport)
#else
#define MDJVU_FUNCTION MDJVU_C_EXPORT_PREFIX __declspec(dllimport)
#define MDJVU_IMPLEMENT __declspec(dllimport)
#endif
#else
#define MDJVU_FUNCTION MDJVU_C_EXPORT_PREFIX
#define MDJVU_IMPLEMENT
#endif
/* Convenience macros. */
#define MDJVU_MALLOC(T) ((T *) malloc(sizeof(T)))
#define MDJVU_MALLOCV(T,N) ((T *) malloc((N) * sizeof(T)))
#define MDJVU_FREE(P) free(P)
#define MDJVU_FREEV(P) free(P)
/* Check that the portability typedefs work as expected.
* If not, returns an error message.
* Returns NULL if OK.
*/
MDJVU_FUNCTION const char *mdjvu_check_sanity(void);
|