Patch: SDL.vcproj

Another patch for the msvc build against trunk.

This change adds following files to the project;
SDL_audiotypecvt.c
SDL_rendercopy.c
SDL_rendercopy.h

Also, it also removes the “IgnoreAllDefaultLibraries”-flag, as some symbols are referenced in an external library;
"_strcmp referenced in function _SDL_ParseAudioFormat"
"__allshr referenced in function _SDL_ConvertMono"

I am not sure about the flag-change, but I have not found any solution to stop MSVC calling external functions for bitshifting. :confused:

VisualC.org/SDL/SDL.vcproj 2006-07-23 09:50:12.000000000 +0200
+++ VisualC/SDL/SDL.vcproj 2006-11-11 03:31:46.000000000 +0100
@@ -79,7 +79,7 @@
OutputFile=".\Debug/SDL.dll"
LinkIncremental="2"
SuppressStartupBanner=“true”

  •   		IgnoreAllDefaultLibraries="true"
    
  •   		IgnoreAllDefaultLibraries="false"
      		GenerateDebugInformation="true"
      		ProgramDatabaseFile=".\Debug/SDL.pdb"
      		SubSystem="2"
    

@@ -178,7 +178,7 @@
OutputFile=".\Release/SDL.dll"
LinkIncremental="1"
SuppressStartupBanner=“true”

  •   		IgnoreAllDefaultLibraries="true"
    
  •   		IgnoreAllDefaultLibraries="false"
      		ProgramDatabaseFile=".\Release/SDL.pdb"
      		SubSystem="2"
      		ImportLibrary=".\Release/SDL.lib"
    

@@ -393,6 +393,10 @@
>

<File

  •   	RelativePath="..\..\src\audio\SDL_audiotypecvt.c"
    
  •   	>
    
  •   </File>
    
  •   <File
      	RelativePath="..\..\src\video\SDL_blit.c"
      	>
      </File>
    

@@ -637,6 +641,14 @@
>

<File

  •   	RelativePath="..\..\src\video\SDL_rendercopy.c"
    
  •   	>
    
  •   </File>
    
  •   <File
    
  •   	RelativePath="..\..\src\video\SDL_rendercopy.h"
    
  •   	>
    
  •   </File>
    
  •   <File
      	RelativePath="..\..\src\video\SDL_renderer_gl.c"
      	>
      </File>

Hello,

This is my stopgap solutions.

“_strcmp referenced in function _SDL_ParseAudioFormat”

I used SDL_strcmp() instead.

“__allshr referenced in function _SDL_ConvertMono”

I used “/ 2” instead of “>> 1”.

I am hoping for a formal correction :slight_smile:

Thanks,On 11/12/06, andreas wrote:

IWATSUKI Hiroyuki URL:mailto:@Hiroyuki_Iwatsuki
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_audio.c.diff
Type: application/octet-stream
Size: 896 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20061113/92cd2c88/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_audiocvt.c.diff
Type: application/octet-stream
Size: 1551 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20061113/92cd2c88/attachment-0001.obj

Hiroyuki Iwatsuki wrote:

I used SDL_strcmp() instead.

doh! Proves how new I am to SDL codebase. :slight_smile:

“__allshr referenced in function _SDL_ConvertMono”

I used “/ 2” instead of “>> 1”.

Very nice!
I have found that there exist a shift in “SDL_stdlib.c” named “_aullshr”, but I am not sure this one is the one intended as “replacement” for the standard library helper routines.
(Looong time since I played with assembly)

I also have issues with these in SDL_mixer.c;

const double max_audioval = 3.40282347e+38F;
const double min_audioval = -3.40282347e+38F;

Normally one would use math.h’s HUGE_VAL-macro, but then we’re in for standard libraries again.
I don’t know which value is correct, but changing it to 3.40282346e+38F makes it compile.

Hi,

I used “/ 2” instead of “>> 1”.

Very nice!

Thank you :slight_smile:

I have found that there exist a shift in “SDL_stdlib.c” named “_aullshr”, but I am not sure this one is the one intended as “replacement” for the standard library helper routines.

Perhaps, the functions in SDL_stdlib.c is used for MSVC.
In addition to them, I want to _allshr function if it is possible.

Normally one would use math.h’s HUGE_VAL-macro, but then we’re in for standard libraries again.
I don’t know which value is correct, but changing it to 3.40282346e+38F makes it compile.

I used FLOAT_MIN and FLOAT_MAX.
However, float.h is necessary.

In MSVC++ 2005 EE’s float.h,
FLOAT_MAX macro is defined 3.402823466e+38F.
FLOAT_MIN macro is defined 1.175494351e-38F.

To our regret, I don’t know whether it is correct to use these.

Thanks,On 11/13/06, andreas wrote:

IWATSUKI Hiroyuki URL:mailto:@Hiroyuki_Iwatsuki
-------------- next part --------------
Index: src/audio/SDL_mixer.c

— src/audio/SDL_mixer.c (revision 2909)
+++ src/audio/SDL_mixer.c (working copy)
@@ -302,9 +302,6 @@
float *dst32 = (float *) dst;
float src1, src2;
double dst_sample;

  •        /* !!! FIXME: are these right? */
    
  •        const double max_audioval = 3.40282347e+38F;
    
  •        const double min_audioval = -3.40282347e+38F;
    
           len /= 4;
           while (len--) {
    

@@ -313,10 +310,10 @@
src32++;

             dst_sample = ((double) src1) + ((double) src2);
  •            if (dst_sample > max_audioval) {
    
  •                dst_sample = max_audioval;
    
  •            } else if (dst_sample < min_audioval) {
    
  •                dst_sample = min_audioval;
    
  •            if (dst_sample > FLT_MAX) {
    
  •                dst_sample = FLT_MAX;
    
  •            } else if (dst_sample < FLT_MIN) {
    
  •                dst_sample = FLT_MIN;
               }
               *(dst32++) = SDL_SwapFloatLE((float) dst_sample);
           }
    

@@ -331,9 +328,6 @@
float *dst32 = (float *) dst;
float src1, src2;
double dst_sample;

  •        /* !!! FIXME: are these right? */
    
  •        const double max_audioval = 3.40282347e+38F;
    
  •        const double min_audioval = -3.40282347e+38F;
    
           len /= 4;
           while (len--) {
    

@@ -342,10 +336,10 @@
src32++;

             dst_sample = ((double) src1) + ((double) src2);
  •            if (dst_sample > max_audioval) {
    
  •                dst_sample = max_audioval;
    
  •            } else if (dst_sample < min_audioval) {
    
  •                dst_sample = min_audioval;
    
  •            if (dst_sample > FLT_MAX) {
    
  •                dst_sample = FLT_MAX;
    
  •            } else if (dst_sample < FLT_MIN) {
    
  •                dst_sample = FLT_MIN;
               }
               *(dst32++) = SDL_SwapFloatBE((float) dst_sample);
           }