This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 349 for ps


Ignore:
Timestamp:
06/02/04 17:12:48 (21 years ago)
Author:
Simon Brenner
Message:

../lib/lib.cpp

Location:
ps/trunk/source/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/lib/lib.h

    r334 r349  
    5656
    5757
     58#ifdef _WIN32
    5859#define CHECK_ERR(func)\
    5960STMT(\
     
    6667    }\
    6768)
    68 
     69#else
     70#define CHECK_ERR(func)\
     71STMT(\
     72    int err = (int)(func);\
     73    if(err < 0)\
     74    {\
     75        debug_out("%s:%d: FYI: CHECK_ERR reports that a function failed."\
     76                    "feel free to ignore or suppress this warning.", __FILE__, __LINE__);\
     77        return err;\
     78    }\
     79)
     80#endif
    6981
    7082enum LibError
     
    132144// VC6/7 don't realize the macro is constant
    133145// (it should be useable as a switch{} expression)
    134 #ifdef BIG_ENDIAN
     146#if __BYTE_ORDER == __BIG_ENDIAN
    135147#define FOURCC(a,b,c,d) ( ((u32)a << 24) | ((u32)b << 16) | \
    136148    ((u32)c << 8 ) | ((u32)d << 0 ) )
     
    186198// no parameters, cdecl (CC_CDECL_0)
    187199extern int atexit2(void* func);
     200inline int atexit2(void (*func)())
     201{
     202    atexit2((void *)func);
     203}
    188204
    189205
     
    227243static inline u16 read_le16(const void* p)
    228244{
    229 #ifdef BIG_ENDIAN
     245#if __BYTE_ORDER == __BIG_ENDIAN
    230246    const u8* _p = (const u8*)p;
    231247    return (u16)_p[0] | (u16)_p[1] << 8;
     
    238254static inline u32 read_le32(const void* p)
    239255{
    240 #ifdef BIG_ENDIAN
     256#if __BYTE_ORDER == __BIG_ENDIAN
    241257    u32 t = 0;
    242258    for(int i = 0; i < 4; i++)
     
    270286
    271287
    272 extern long round(double);
    273288extern u16 fp_to_u16(double in);
    274289
  • ps/trunk/source/lib/sysdep/sysdep.cpp

    r221 r349  
    1717void wdisplay_msg(const wchar_t* caption, const wchar_t* msg)
    1818{
    19     fwprintf(stderr, L"%ws: %ws\n", caption, msg);
     19    fwprintf(stderr, L"%ls: %ls\n", caption, msg);
    2020}
    2121
     
    3737
    3838#endif  // #ifndef _WIN32
     39
     40#ifdef _MSC_VER
     41
     42double round(double x)
     43{
     44    return (long)(x + 0.5);
     45}
     46
     47#endif
  • ps/trunk/source/lib/sysdep/sysdep.h

    r216 r349  
    1616extern void check_heap();
    1717
     18#ifdef _MSC_VER
     19extern double round(double);
     20#endif
     21
    1822#ifdef __cplusplus
    1923}
Note: See TracChangeset for help on using the changeset viewer.