Results 1 to 4 of 4

Thread: Tests Sound SEE not compile on Linux

  1. #1

    Default Tests Sound SEE not compile on Linux

    Hi.
    The test Tests/Sound/SSE not compile on Linux, is not just a warning.
    File test.app line 130:
    Code:
    float dummy;
    in_float_buffer1[cnt] = modf(( float (random_number)) / 13.223f, &dummy);
    in_float_buffer2[cnt] = modf(( float (random_number)) / 53.321f, &dummy);
    The func. modf is for double not float.
    Code:
    SYNOPSIS
         #include <math.h>
    
         double modf(double x, double *iptr);
         float modff(float x, float *iptr);
         long double modfl(long double x, long double *iptr);
    I ended up choosing modff.

    Code:
    ClanLib Test Suite:
    -------------------
    Target: LINUX
    For clanSound SSE functions
    All Tests Complete
    Regards

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    C++98 says:

    Code:
         double modf (double x     , double* intpart);
          float modf (float x      , float* intpart);
    long double modf (long double x, long double* intpart);
    According to http://www.cplusplus.com/reference/cmath/modf/

    Maybe we are not using the correct header file (#include <cmath> vs <math.h> vs <math>)

  3. #3

    Default

    If you're right.
    I propose the following:
    The project is compiled with the standard "-std=c++0x".
    Standard say for cmath:
    1. The contents of these headers are the same as the Standard C library headers <math.h> and <stdlib.h>
      respectively, with the following changes:
      8 - In addition to the double versions of the math functions in <cmath>, C++ adds float and long double
      overloaded versions of these functions, with the same semantics.


    Then I force the compiler to use the standard library.
    Code:
    std::modf(...):
    Attached Files Attached Files

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    That's good.

    Applied Patch

    Many Thanks.

Similar Threads

  1. Can compile a release version but can't compile a debug version
    By cymcrh55 in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 07-16-2013, 01:55 PM
  2. a Tests/Display/ShaderEffect/Makefile
    By bvanevery in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 04-09-2013, 11:29 AM
  3. Compile Error In Ubuntu Linux
    By Kurisu in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 08-18-2008, 05:38 PM
  4. ClanLib-0.8.0\Tests\NetSessionsTest problem
    By inxbus in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 01-06-2007, 09:11 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •