src/hermes/HeadX86.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 21 Sep 2003 18:32:04 +0000
changeset 720 f90d80d68071
parent 366 c94b390687d2
child 1197 bb5ace455586
permissions -rw-r--r--
N Sep 17 8791 Sam Lantinga Re: tks source released
Date: Sun, 07 Sep 2003 02:51:58 +0200
From: Stephane Marchesin
Subject: [SDL] Two little patches

Compiling SDL with a recent gcc (gcc 3.3.1, 3.3 doesn't have this
behaviour) gives some nasty warnings :

SDL_blit_A.c: In function `BlitRGBtoRGBSurfaceAlpha128MMX':
SDL_blit_A.c:223: warning: integer constant is too large for "long" type
SDL_blit_A.c:225: warning: integer constant is too large for "long" type
SDL_blit_A.c:227: warning: integer constant is too large for "long" type
[...]

The first attached patch (longlongfix.patch) tells gcc to really treat
those constants as unsigned long long and not long.

The second patch (nasinclude.patch) fixes an include problem I had while
compiling nas audio : when the <audio/audiolib.h> file lies in
/usr/X11R6/include, a -I/usr/X11R6/include option is needed or the file
isn't found.
slouken@0
     1
/*
slouken@0
     2
   Header definitions for the x86 routines for the HERMES library
slouken@0
     3
   Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at)
slouken@0
     4
   This source code is licensed under the GNU LGPL
slouken@0
     5
  
slouken@0
     6
   Please refer to the file COPYING.LIB contained in the distribution for
slouken@0
     7
   licensing conditions
slouken@0
     8
*/
slouken@0
     9
slouken@0
    10
#ifndef __HERMES_HEAD_X86__
slouken@0
    11
#define __HERMES_HEAD_X86__
slouken@0
    12
slouken@0
    13
slouken@0
    14
#ifdef X86_ASSEMBLER
slouken@0
    15
slouken@0
    16
/* If you can't stand IFDEFS, then close your eyes now, please :) */
slouken@0
    17
slouken@0
    18
/* Ok, we start with normal function definitions */
slouken@0
    19
#ifdef __cplusplus
slouken@0
    20
extern "C" {
slouken@0
    21
#endif
slouken@0
    22
slouken@0
    23
slouken@0
    24
void STACKCALL ConvertX86(HermesConverterInterface *);
slouken@0
    25
void STACKCALL ClearX86_32(HermesClearInterface *);
slouken@0
    26
void STACKCALL ClearX86_24(HermesClearInterface *);
slouken@0
    27
void STACKCALL ClearX86_16(HermesClearInterface *);
slouken@0
    28
void STACKCALL ClearX86_8(HermesClearInterface *);
slouken@0
    29
slouken@0
    30
int STACKCALL Hermes_X86_CPU();
slouken@0
    31
slouken@0
    32
void ConvertX86p32_32BGR888();
slouken@0
    33
void ConvertX86p32_32RGBA888();
slouken@0
    34
void ConvertX86p32_32BGRA888();
slouken@0
    35
void ConvertX86p32_24RGB888();
slouken@0
    36
void ConvertX86p32_24BGR888();
slouken@0
    37
void ConvertX86p32_16RGB565();
slouken@0
    38
void ConvertX86p32_16BGR565();
slouken@0
    39
void ConvertX86p32_16RGB555();
slouken@0
    40
void ConvertX86p32_16BGR555();
slouken@0
    41
void ConvertX86p32_8RGB332();
slouken@0
    42
slouken@0
    43
void ConvertX86p16_32RGB888();
slouken@0
    44
void ConvertX86p16_32BGR888();
slouken@0
    45
void ConvertX86p16_32RGBA888();
slouken@0
    46
void ConvertX86p16_32BGRA888();
slouken@0
    47
void ConvertX86p16_24RGB888();
slouken@0
    48
void ConvertX86p16_24BGR888();
slouken@0
    49
void ConvertX86p16_16BGR565();
slouken@0
    50
void ConvertX86p16_16RGB555();
slouken@0
    51
void ConvertX86p16_16BGR555();
slouken@0
    52
void ConvertX86p16_8RGB332();
slouken@0
    53
slouken@0
    54
void CopyX86p_4byte();
slouken@0
    55
void CopyX86p_3byte();
slouken@0
    56
void CopyX86p_2byte();
slouken@0
    57
void CopyX86p_1byte();
slouken@0
    58
slouken@0
    59
void ConvertX86pI8_32();
slouken@0
    60
void ConvertX86pI8_24();
slouken@0
    61
void ConvertX86pI8_16();
slouken@0
    62
slouken@366
    63
extern int ConvertX86p16_32RGB888_LUT_X86[512];
slouken@366
    64
extern int ConvertX86p16_32BGR888_LUT_X86[512];
slouken@366
    65
extern int ConvertX86p16_32RGBA888_LUT_X86[512];
slouken@366
    66
extern int ConvertX86p16_32BGRA888_LUT_X86[512];
slouken@0
    67
  
slouken@0
    68
#ifdef __cplusplus
slouken@0
    69
}
slouken@0
    70
#endif
slouken@0
    71
slouken@0
    72
slouken@0
    73
slouken@0
    74
slouken@0
    75
/* Now fix up the ELF underscore problem */
slouken@0
    76
slouken@0
    77
#if defined(__ELF__) && defined(__GNUC__)
slouken@0
    78
  #ifdef __cplusplus
slouken@0
    79
  extern "C" {
slouken@0
    80
  #endif
slouken@0
    81
slouken@0
    82
  int Hermes_X86_CPU() __attribute__ ((alias ("_Hermes_X86_CPU")));
slouken@0
    83
slouken@0
    84
  void ConvertX86(HermesConverterInterface *) __attribute__ ((alias ("_ConvertX86")));
slouken@0
    85
slouken@0
    86
#if 0
slouken@0
    87
  void ClearX86_32(HermesClearInterface *) __attribute__ ((alias ("_ClearX86_32")));
slouken@0
    88
  void ClearX86_24(HermesClearInterface *)  __attribute__ ((alias ("_ClearX86_24")));
slouken@0
    89
  void ClearX86_16(HermesClearInterface *)  __attribute__ ((alias ("_ClearX86_16")));
slouken@0
    90
  void ClearX86_8(HermesClearInterface *)  __attribute__ ((alias ("_ClearX86_8")));
slouken@0
    91
#endif
slouken@0
    92
slouken@0
    93
  void ConvertX86p32_32BGR888() __attribute__ ((alias ("_ConvertX86p32_32BGR888")));
slouken@0
    94
  void ConvertX86p32_32RGBA888() __attribute__ ((alias ("_ConvertX86p32_32RGBA888")));
slouken@0
    95
  void ConvertX86p32_32BGRA888() __attribute__ ((alias ("_ConvertX86p32_32BGRA888")));
slouken@0
    96
  void ConvertX86p32_24RGB888() __attribute__ ((alias ("_ConvertX86p32_24RGB888")));
slouken@0
    97
  void ConvertX86p32_24BGR888() __attribute__ ((alias ("_ConvertX86p32_24BGR888")));
slouken@0
    98
  void ConvertX86p32_16RGB565() __attribute__ ((alias ("_ConvertX86p32_16RGB565")));
slouken@0
    99
  void ConvertX86p32_16BGR565() __attribute__ ((alias ("_ConvertX86p32_16BGR565")));
slouken@0
   100
  void ConvertX86p32_16RGB555() __attribute__ ((alias ("_ConvertX86p32_16RGB555")));
slouken@0
   101
  void ConvertX86p32_16BGR555() __attribute__ ((alias ("_ConvertX86p32_16BGR555")));
slouken@0
   102
  void ConvertX86p32_8RGB332() __attribute__ ((alias ("_ConvertX86p32_8RGB332")));
slouken@0
   103
slouken@0
   104
#if 0
slouken@0
   105
  void ConvertX86p16_32RGB888() __attribute__ ((alias ("_ConvertX86p16_32RGB888")));
slouken@0
   106
  void ConvertX86p16_32BGR888() __attribute__ ((alias ("_ConvertX86p16_32BGR888")));
slouken@0
   107
  void ConvertX86p16_32RGBA888() __attribute__ ((alias ("_ConvertX86p16_32RGBA888")));
slouken@0
   108
  void ConvertX86p16_32BGRA888() __attribute__ ((alias ("_ConvertX86p16_32BGRA888")));
slouken@0
   109
  void ConvertX86p16_24RGB888() __attribute__ ((alias ("_ConvertX86p16_24RGB888")));
slouken@0
   110
  void ConvertX86p16_24BGR888() __attribute__ ((alias ("_ConvertX86p16_24BGR888")));
slouken@0
   111
#endif
slouken@0
   112
  void ConvertX86p16_16BGR565() __attribute__ ((alias ("_ConvertX86p16_16BGR565")));
slouken@0
   113
  void ConvertX86p16_16RGB555() __attribute__ ((alias ("_ConvertX86p16_16RGB555")));
slouken@0
   114
  void ConvertX86p16_16BGR555() __attribute__ ((alias ("_ConvertX86p16_16BGR555")));
slouken@0
   115
  void ConvertX86p16_8RGB332() __attribute__ ((alias ("_ConvertX86p16_8RGB332")));
slouken@0
   116
slouken@0
   117
#if 0
slouken@0
   118
  void CopyX86p_4byte() __attribute__ ((alias ("_CopyX86p_4byte")));
slouken@0
   119
  void CopyX86p_3byte() __attribute__ ((alias ("_CopyX86p_3byte")));
slouken@0
   120
  void CopyX86p_2byte() __attribute__ ((alias ("_CopyX86p_2byte")));
slouken@0
   121
  void CopyX86p_1byte() __attribute__ ((alias ("_CopyX86p_1byte")));
slouken@0
   122
slouken@0
   123
  void ConvertX86pI8_32() __attribute__ ((alias ("_ConvertX86pI8_32")));
slouken@0
   124
  void ConvertX86pI8_24() __attribute__ ((alias ("_ConvertX86pI8_24")));
slouken@0
   125
  void ConvertX86pI8_16() __attribute__ ((alias ("_ConvertX86pI8_16")));
slouken@0
   126
slouken@366
   127
  extern int ConvertX86p16_32RGB888_LUT_X86[512] __attribute__ ((alias ("_ConvertX86p16_32RGB888_LUT_X86")));
slouken@366
   128
  extern int ConvertX86p16_32BGR888_LUT_X86[512] __attribute__ ((alias ("_ConvertX86p16_32BGR888_LUT_X86")));
slouken@366
   129
  extern int ConvertX86p16_32RGBA888_LUT_X86[512] __attribute__ ((alias ("_ConvertX86p16_32RGBA888_LUT_X86")));
slouken@366
   130
  extern int ConvertX86p16_32BGRA888_LUT_X86[512] __attribute__ ((alias ("_ConvertX86p16_32BGRA888_LUT_X86")));
slouken@0
   131
#endif
slouken@0
   132
slouken@0
   133
  #ifdef __cplusplus
slouken@0
   134
  }
slouken@0
   135
  #endif
slouken@0
   136
slouken@0
   137
#endif /* ELF & GNU */
slouken@0
   138
slouken@0
   139
slouken@0
   140
slouken@0
   141
/* Make it run with WATCOM C */
slouken@0
   142
#ifdef __WATCOMC__
slouken@0
   143
#pragma warning 601 9
slouken@0
   144
slouken@0
   145
#pragma aux Hermes_X86_CPU "_*"
slouken@0
   146
slouken@0
   147
#pragma aux ConvertX86 "_*" modify [EAX EBX ECX EDX ESI EDI]
slouken@0
   148
#pragma aux ClearX86_32 "_*" modify [EAX EBX ECX EDX ESI EDI]
slouken@0
   149
#pragma aux ClearX86_24 "_*" modify [EAX EBX ECX EDX ESI EDI]
slouken@0
   150
#pragma aux ClearX86_16 "_*" modify [EAX EBX ECX EDX ESI EDI]
slouken@0
   151
#pragma aux ClearX86_8 "_*" modify [EAX EBX ECX EDX ESI EDI]
slouken@0
   152
slouken@0
   153
#pragma aux ConvertX86p32_32BGR888 "_*"
slouken@0
   154
#pragma aux ConvertX86p32_32RGBA888 "_*"
slouken@0
   155
#pragma aux ConvertX86p32_32BGRA888 "_*"
slouken@0
   156
#pragma aux ConvertX86p32_24RGB888 "_*"
slouken@0
   157
#pragma aux ConvertX86p32_24BGR888 "_*"
slouken@0
   158
#pragma aux ConvertX86p32_16RGB565 "_*"
slouken@0
   159
#pragma aux ConvertX86p32_16BGR565 "_*"
slouken@0
   160
#pragma aux ConvertX86p32_16RGB555 "_*"
slouken@0
   161
#pragma aux ConvertX86p32_16BGR555 "_*"
slouken@0
   162
#pragma aux ConvertX86p32_8RGB332 "_*"
slouken@0
   163
slouken@0
   164
#pragma aux ConvertX86p16_32RGB888 "_*"
slouken@0
   165
#pragma aux ConvertX86p16_32BGR888 "_*"
slouken@0
   166
#pragma aux ConvertX86p16_32RGBA888 "_*"
slouken@0
   167
#pragma aux ConvertX86p16_32BGRA888 "_*"
slouken@0
   168
#pragma aux ConvertX86p16_24RGB888 "_*"
slouken@0
   169
#pragma aux ConvertX86p16_24BGR888 "_*"
slouken@0
   170
#pragma aux ConvertX86p16_16BGR565 "_*"
slouken@0
   171
#pragma aux ConvertX86p16_16RGB555 "_*"
slouken@0
   172
#pragma aux ConvertX86p16_16BGR555 "_*"
slouken@0
   173
#pragma aux ConvertX86p16_8RGB332 "_*"
slouken@0
   174
slouken@0
   175
#pragma aux CopyX86p_4byte "_*"
slouken@0
   176
#pragma aux CopyX86p_3byte "_*"
slouken@0
   177
#pragma aux CopyX86p_2byte "_*"
slouken@0
   178
#pragma aux CopyX86p_1byte "_*"
slouken@0
   179
slouken@0
   180
#pragma aux ConvertX86pI8_32 "_*"
slouken@0
   181
#pragma aux ConvertX86pI8_24 "_*"
slouken@0
   182
#pragma aux ConvertX86pI8_16 "_*"
slouken@0
   183
slouken@0
   184
#pragma aux ConvertX86p16_32RGB888_LUT_X86 "_*"
slouken@0
   185
#pragma aux ConvertX86p16_32BGR888_LUT_X86 "_*"
slouken@0
   186
#pragma aux ConvertX86p16_32RGBA888_LUT_X86 "_*"
slouken@0
   187
#pragma aux ConvertX86p16_32BGRA888_LUT_X86 "_*"
slouken@0
   188
slouken@0
   189
#endif /* __WATCOMC__ */
slouken@0
   190
slouken@0
   191
slouken@0
   192
#endif /* X86_ASSEMBLER */
slouken@0
   193
slouken@0
   194
slouken@0
   195
#endif