Commit d2d17013 authored by David Turner's avatar David Turner
Browse files

major reformatting of the sources:

  FT_EXPORT_DEF    => FT_EXPORT
  FT_EXPORT_FUNC => FT_EXPORT_DEF
  BASE_DEF               => FT_BASE
  BASE_FUNC            => FT_BASE_DEF
  LOCAL_DEF             => FT_LOCAL
  LOCAL_FUNC          => FT_LOCAL_DEF
  LOCAL_FUNC_X     => FT_CALLBACK_DEF
  LOCAL_DEF_X       => FT_CALLBACK_TABLE
  FT_CPLUSPLUS     => FT_CALLBACK_TABLE_DEF
parent d2ac68bd
......@@ -155,34 +155,34 @@
/* declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT_DEF and FT_EXPORT_FUNC. */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_FUNC( return_type ) */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_FUNC( FT_Error ) */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT_DEF and */
/* FT_EXPORT_FUNC here if you want. If you leave them undefined, they */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
/* will be later automatically defined as `extern return_type' to */
/* allow normal compilation. */
/* */
#undef FT_EXPORT
#undef FT_EXPORT_DEF
#undef FT_EXPORT_FUNC
/*************************************************************************/
......
......@@ -92,7 +92,7 @@
/* <Return> */
/* block :: The address of newly allocated block. */
/* */
LOCAL_FUNC_X
FT_CALLBACK_DEF
void* ft_alloc( FT_Memory memory,
long size )
{
......@@ -122,7 +122,7 @@
/* <Return> */
/* The address of the reallocated memory block. */
/* */
LOCAL_FUNC_X
FT_CALLBACK_DEF
void* ft_realloc( FT_Memory memory,
long cur_size,
long new_size,
......@@ -148,7 +148,7 @@
/* */
/* block :: The address of block in memory to be freed. */
/* */
LOCAL_FUNC_X
FT_CALLBACK_DEF
void ft_free( FT_Memory memory,
void* block )
{
......@@ -190,7 +190,7 @@
/* <Input> */
/* stream :: A pointer to the stream object. */
/* */
LOCAL_FUNC_X
FT_CALLBACK_DEF
void ft_close_stream( FT_Stream stream )
{
munmap( (MUNMAP_ARG_CAST)stream->descriptor.pointer, stream->size );
......@@ -218,7 +218,7 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_FUNC( FT_Error ) FT_New_Stream( const char* filepathname,
FT_EXPORT_DEF( FT_Error ) FT_New_Stream( const char* filepathname,
FT_Stream stream )
{
int file;
......@@ -296,7 +296,7 @@
/* <Return> */
/* A pointer to the new memory object. 0 in case of error. */
/* */
FT_EXPORT_FUNC( FT_Memory ) FT_New_Memory( void )
FT_EXPORT_DEF( FT_Memory ) FT_New_Memory( void )
{
FT_Memory memory;
......@@ -325,7 +325,7 @@
/* <Input> */
/* memory :: A handle to the memory manager. */
/* */
FT_EXPORT_FUNC( void ) FT_Done_Memory( FT_Memory memory )
FT_EXPORT_DEF( void ) FT_Done_Memory( FT_Memory memory )
{
free( memory );
}
......
......@@ -13,6 +13,30 @@
# fully.
# Test for DJGPP by checking the DJGPP environment variable, which must be
# set in order to use the system (ie. it will always be present when the
# `make' utility is run).
#
ifeq ($(PLATFORM),ansi)
ifdef DJGPP
# We are definitely using DJGPP
PLATFORM := dos
DELETE := del
COPY := copy
CONFIG_FILE := dos-gcc.mk
SEP := /
ifndef CC
CC := gcc
endif # test CC
setup : dos_setup
endif # test DJGPP
endif # test PLATFORM
# We test for the COMSPEC environment variable, then run the `ver'
# command-line program to see if its output contains the word `Dos'.
#
......
......@@ -15,7 +15,8 @@
SEP := /
CLEAN_LIBRARY := $(DELETE) $@
include $(TOP)/builds/dos/dos-def.mk
include $(TOP)/builds/compiler/gcc.mk
include $(TOP)/builds/dos/dos-def.mk
# EOF
......@@ -155,34 +155,34 @@
/* declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT_DEF and FT_EXPORT_FUNC. */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_FUNC( return_type ) */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_FUNC( FT_Error ) */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT_DEF and */
/* FT_EXPORT_FUNC here if you want. If you leave them undefined, they */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
/* will be later automatically defined as `extern return_type' to */
/* allow normal compilation. */
/* */
#undef FT_EXPORT
#undef FT_EXPORT_DEF
#undef FT_EXPORT_FUNC
/*************************************************************************/
......
......@@ -92,7 +92,7 @@
/* <Return> */
/* block :: The address of newly allocated block. */
/* */
LOCAL_FUNC_X
FT_CALLBACK_DEF
void* ft_alloc( FT_Memory memory,
long size )
{
......@@ -122,7 +122,7 @@
/* <Return> */
/* The address of the reallocated memory block. */
/* */
LOCAL_FUNC_X
FT_CALLBACK_DEF
void* ft_realloc( FT_Memory memory,
long cur_size,
long new_size,
......@@ -148,7 +148,7 @@
/* */
/* block :: The address of block in memory to be freed. */
/* */
LOCAL_FUNC_X
FT_CALLBACK_DEF
void ft_free( FT_Memory memory,
void* block )
{
......@@ -190,7 +190,7 @@
/* <Input> */
/* stream :: A pointer to the stream object. */
/* */
LOCAL_FUNC_X
FT_CALLBACK_DEF
void ft_close_stream( FT_Stream stream )
{
munmap( (MUNMAP_ARG_CAST)stream->descriptor.pointer, stream->size );
......@@ -218,7 +218,7 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_FUNC( FT_Error ) FT_New_Stream( const char* filepathname,
FT_EXPORT_DEF( FT_Error ) FT_New_Stream( const char* filepathname,
FT_Stream stream )
{
int file;
......@@ -296,7 +296,7 @@
/* <Return> */
/* A pointer to the new memory object. 0 in case of error. */
/* */
FT_EXPORT_FUNC( FT_Memory ) FT_New_Memory( void )
FT_EXPORT_DEF( FT_Memory ) FT_New_Memory( void )
{
FT_Memory memory;
......@@ -325,7 +325,7 @@
/* <Input> */
/* memory :: A handle to the memory manager. */
/* */
FT_EXPORT_FUNC( void ) FT_Done_Memory( FT_Memory memory )
FT_EXPORT_DEF( void ) FT_Done_Memory( FT_Memory memory )
{
free( memory );
}
......
......@@ -155,34 +155,34 @@
/* declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT_DEF and FT_EXPORT_FUNC. */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_FUNC( return_type ) */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_FUNC( FT_Error ) */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT_DEF and */
/* FT_EXPORT_FUNC here if you want. If you leave them undefined, they */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
/* will be later automatically defined as `extern return_type' to */
/* allow normal compilation. */
/* */
#undef FT_EXPORT
#undef FT_EXPORT_DEF
#undef FT_EXPORT_FUNC
/*************************************************************************/
......
......@@ -28,7 +28,7 @@
</h3>
<center>
<table width="75%">
<table width="550">
<tr><td>
<hr>
......
......@@ -28,7 +28,7 @@
</h3>
<center>
<table width="75%">
<table width="550">
<tr><td>
<hr>
......
......@@ -164,10 +164,10 @@
/* cache sub-system internals. */
/* */
FT_EXPORT_FUNC( FT_Error ) FTC_ChunkNode_Init( FTC_ChunkNode node,
FTC_ChunkSet cset,
FT_UInt index,
FT_Bool alloc );
FT_EXPORT( FT_Error ) FTC_ChunkNode_Init( FTC_ChunkNode node,
FTC_ChunkSet cset,
FT_UInt index,
FT_Bool alloc );
#define FTC_ChunkNode_Ref( n ) \
FTC_CACHENODE_TO_DATA_P( &(n)->root )->ref_count++
......@@ -176,18 +176,18 @@
FTC_CACHENODE_TO_DATA_P( &(n)->root )->ref_count--
FT_EXPORT_DEF( void ) FTC_ChunkNode_Destroy( FTC_ChunkNode node );
FT_EXPORT( void ) FTC_ChunkNode_Destroy( FTC_ChunkNode node );
FT_EXPORT_DEF( FT_Error ) FTC_Chunk_Cache_Init( FTC_Chunk_Cache cache );
FT_EXPORT( FT_Error ) FTC_Chunk_Cache_Init( FTC_Chunk_Cache cache );
FT_EXPORT_DEF( void ) FTC_Chunk_Cache_Done( FTC_Chunk_Cache cache );
FT_EXPORT( void ) FTC_Chunk_Cache_Done( FTC_Chunk_Cache cache );
FT_EXPORT_DEF( FT_Error ) FTC_ChunkSet_New( FTC_Chunk_Cache cache,
FT_Pointer type,
FTC_ChunkSet* aset );
FT_EXPORT( FT_Error ) FTC_ChunkSet_New( FTC_Chunk_Cache cache,
FT_Pointer type,
FTC_ChunkSet* aset );
FT_EXPORT_DEF( FT_Error ) FTC_ChunkSet_Lookup_Node(
FT_EXPORT( FT_Error ) FTC_ChunkSet_Lookup_Node(
FTC_ChunkSet cset,
FT_UInt glyph_index,
FTC_ChunkNode* anode,
......
......@@ -168,7 +168,7 @@
/* cache sub-system internals. */
/* */
FT_EXPORT_FUNC( void ) FTC_GlyphNode_Init( FTC_GlyphNode node,
FT_EXPORT_DEF( void ) FTC_GlyphNode_Init( FTC_GlyphNode node,
FTC_GlyphSet gset,
FT_UInt gindex );
......@@ -179,19 +179,19 @@
FTC_CACHENODE_TO_DATA_P( &(n)->root )->ref_count--
FT_EXPORT_DEF( void ) FTC_GlyphNode_Destroy( FTC_GlyphNode node,
FTC_Glyph_Cache cache );
FT_EXPORT( void ) FTC_GlyphNode_Destroy( FTC_GlyphNode node,
FTC_Glyph_Cache cache );
FT_EXPORT_DEF( FT_Error ) FTC_Glyph_Cache_Init( FTC_Glyph_Cache cache );
FT_EXPORT( FT_Error ) FTC_Glyph_Cache_Init( FTC_Glyph_Cache cache );
FT_EXPORT_DEF( void ) FTC_Glyph_Cache_Done( FTC_Glyph_Cache cache );
FT_EXPORT( void ) FTC_Glyph_Cache_Done( FTC_Glyph_Cache cache );
FT_EXPORT_DEF( FT_Error ) FTC_GlyphSet_New( FTC_Glyph_Cache cache,
FT_Pointer type,
FTC_GlyphSet* aset );
FT_EXPORT( FT_Error ) FTC_GlyphSet_New( FTC_Glyph_Cache cache,
FT_Pointer type,
FTC_GlyphSet* aset );
FT_EXPORT_DEF( FT_Error ) FTC_GlyphSet_Lookup_Node(
FT_EXPORT( FT_Error ) FTC_GlyphSet_Lookup_Node(
FTC_GlyphSet gset,
FT_UInt glyph_index,
FTC_GlyphNode* anode );
......
......@@ -119,8 +119,8 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_DEF( FT_Error ) FTC_Image_Cache_New( FTC_Manager manager,
FTC_Image_Cache* acache );
FT_EXPORT( FT_Error ) FTC_Image_Cache_New( FTC_Manager manager,
FTC_Image_Cache* acache );
/*************************************************************************/
......@@ -154,10 +154,10 @@
/* taken by the glyphs it holds, the returned glyph might disappear */
/* on a later invocation of this function! It's a cache after all... */
/* */
FT_EXPORT_DEF( FT_Error ) FTC_Image_Cache_Lookup( FTC_Image_Cache cache,
FTC_Image_Desc* desc,
FT_UInt gindex,
FT_Glyph* aglyph );
FT_EXPORT( FT_Error ) FTC_Image_Cache_Lookup( FTC_Image_Cache cache,
FTC_Image_Desc* desc,
FT_UInt gindex,
FT_Glyph* aglyph );
#ifdef __cplusplus
......
......@@ -155,7 +155,7 @@
/* The reason this function is exported is to allow client-specific */
/* cache classes. */
/* */
FT_EXPORT_DEF( void ) FTC_Manager_Compress( FTC_Manager manager );
FT_EXPORT( void ) FTC_Manager_Compress( FTC_Manager manager );
/*************************************************************************/
......
......@@ -53,13 +53,13 @@
} FTC_SBitRec;
FT_EXPORT_DEF( FT_Error ) FTC_SBit_Cache_New( FTC_Manager manager,
FTC_SBit_Cache* acache );
FT_EXPORT( FT_Error ) FTC_SBit_Cache_New( FTC_Manager manager,
FTC_SBit_Cache* acache );
FT_EXPORT_DEF( FT_Error ) FTC_SBit_Cache_Lookup( FTC_SBit_Cache cache,
FTC_Image_Desc* desc,
FT_UInt gindex,
FTC_SBit *sbit );
FT_EXPORT( FT_Error ) FTC_SBit_Cache_Lookup( FTC_SBit_Cache cache,
FTC_Image_Desc* desc,
FT_UInt gindex,
FTC_SBit *sbit );
#ifdef __cplusplus
......
......@@ -141,33 +141,33 @@
} FT_LruRec;
FT_EXPORT_DEF( FT_Error ) FT_Lru_New( const FT_Lru_Class* clazz,
FT_UInt max_elements,
FT_Pointer user_data,
FT_Memory memory,
FT_Bool pre_alloc,
FT_Lru* alru );
FT_EXPORT( FT_Error ) FT_Lru_New( const FT_Lru_Class* clazz,
FT_UInt max_elements,
FT_Pointer user_data,
FT_Memory memory,
FT_Bool pre_alloc,
FT_Lru* alru );
FT_EXPORT_DEF( void ) FT_Lru_Reset( FT_Lru lru );
FT_EXPORT( void ) FT_Lru_Reset( FT_Lru lru );
FT_EXPORT_DEF( void ) FT_Lru_Done ( FT_Lru lru );
FT_EXPORT( void ) FT_Lru_Done ( FT_Lru lru );
FT_EXPORT_DEF( FT_Error ) FT_Lru_Lookup_Node( FT_Lru lru,
FT_LruKey key,
FT_LruNode* anode );
FT_EXPORT( FT_Error ) FT_Lru_Lookup_Node( FT_Lru lru,
FT_LruKey key,
FT_LruNode* anode );
FT_EXPORT_DEF( FT_Error ) FT_Lru_Lookup( FT_Lru lru,
FT_LruKey key,
FT_Pointer* aobject );
FT_EXPORT( FT_Error ) FT_Lru_Lookup( FT_Lru lru,
FT_LruKey key,
FT_Pointer* aobject );
FT_EXPORT_DEF( void ) FT_Lru_Remove_Node( FT_Lru lru,
FT_LruNode node );
FT_EXPORT( void ) FT_Lru_Remove_Node( FT_Lru lru,
FT_LruNode node );
FT_EXPORT_DEF( void ) FT_Lru_Remove_Selection( FT_Lru lru,
FT_Lru_Selector selector,
FT_Pointer data );
FT_EXPORT( void ) FT_Lru_Remove_Selection( FT_Lru lru,
FT_Lru_Selector selector,
FT_Pointer data );
#ifdef __cplusplus
......
......@@ -159,64 +159,64 @@
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define LOCAL_DEF static
#define LOCAL_FUNC static
#define FT_LOCAL static
#define FT_LOCAL_DEF static
#else
#ifdef __cplusplus
#define LOCAL_DEF extern "C"
#define LOCAL_FUNC extern "C"
#define FT_LOCAL extern "C"
#define FT_LOCAL_DEF extern "C"
#else
#define LOCAL_DEF extern
#define LOCAL_FUNC extern
#define FT_LOCAL extern
#define FT_LOCAL_DEF extern
#endif
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
#ifndef BASE_DEF
#ifndef FT_BASE
#ifdef __cplusplus
#define BASE_DEF( x ) extern "C" x
#define FT_BASE( x ) extern "C" x
#else
#define BASE_DEF( x ) extern x
#define FT_BASE( x ) extern x
#endif
#endif /* !BASE_DEF */
#endif /* !FT_BASE */
#ifndef BASE_FUNC
#ifndef FT_BASE_DEF
#ifdef __cplusplus
#define BASE_FUNC( x ) extern "C" x
#define FT_BASE_DEF( x ) extern "C" x
#else
#define BASE_FUNC( x ) extern x
#define FT_BASE_DEF( x ) extern x
#endif
#endif /* !BASE_FUNC */
#endif /* !FT_BASE_DEF */
#ifndef FT_EXPORT_DEF
#ifndef FT_EXPORT
#ifdef __cplusplus
#define FT_EXPORT_DEF( x ) extern "C" x
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT_DEF( x ) extern x
#define FT_EXPORT( x ) extern x
#endif
#endif /* !FT_EXPORT_DEF */
#endif /* !FT_EXPORT */
#ifndef FT_EXPORT_FUNC
#ifndef FT_EXPORT_DEF
#ifdef __cplusplus
#define FT_EXPORT_FUNC( x ) extern "C" x
#define FT_EXPORT_DEF( x ) extern "C" x
#else
#define FT_EXPORT_FUNC( x ) extern x
#define FT_EXPORT_DEF( x ) extern x
#endif
#endif /* !FT_EXPORT_FUNC */
#endif /* !FT_EXPORT_DEF */
#ifndef FT_EXPORT_VAR
......@@ -229,6 +229,10 @@
#endif /* !FT_EXPORT_VAR */
/* the following macros are needed to compile the library with a */
/* C++ compiler. Werner insisted on being able to do that even */
/* though we explicitely do not support C++ compilation */
/* */
/* This is special. Within C++, you must specify `extern "C"' for */
/* functions which are used via function pointers, and you also */
......@@ -236,21 +240,26 @@
/* assure C linkage -- it's not possible to have (local) anonymous */
/* functions which are accessed by (global) function pointers. */
/* */
/* */
/* FT_CALLBACK_DEF is used to _define_ a callback function */
/* */
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable */
/* that contains pointers to callback functions */
/* */
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
/* that contains pointers to callback functions */
/* */
#ifdef __cplusplus
#define LOCAL_VAR extern "C"
#define LOCAL_FUNC_X extern "C"
#define FT_CPLUSPLUS( x ) extern "C" x