Changeset 2444

Show
Ignore:
Timestamp:
03/23/08 00:23:08 (10 months ago)
Author:
edmanm
Message:

r256@lysithea: edmanm | 2008-03-23 00:22:58 -0400
Check for limits.h and sys/limits.h, and include them in zlibbytearray.cpp so
we can use UINT_MAX.

Location:
vidalia/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • vidalia/trunk/CMakeLists.txt

    r2441 r2444  
    3232include(${QT_USE_FILE}) 
    3333include(${CMAKE_SOURCE_DIR}/cmake/VidaliaMacros.cmake) 
     34include(CheckIncludeFile) 
    3435include(CheckIncludeFileCXX) 
     36include(CheckTypeSize) 
    3537include(CPack) 
    3638 
     
    6163endif(USE_QSSLSOCKET) 
    6264 
     65## Check for system header files 
     66check_include_file("limits.h" HAVE_LIMITS_H) 
     67check_include_file("sys/limits.h" HAVE_SYS_LIMITS_H) 
     68 
     69## Check fo the sizes of various data types 
     70check_type_size(int SIZEOF_INT) 
     71 
    6372## Write out a configuration file 
    6473configure_file( 
  • vidalia/trunk/config.h.in

    r2354 r2444  
    33 
    44#cmakedefine USE_QSSLSOCKET 
     5 
     6#cmakedefine HAVE_LIMITS_H 
     7 
     8#cmakedefine HAVE_SYS_LIMITS_H 
     9 
     10#cmakedefine SIZEOF_INT @SIZEOF_INT@ 
     11 
  • vidalia/trunk/src/util/zlibbytearray.cpp

    r2439 r2444  
    5252 
    5353#include <QString> 
     54 
     55#include "config.h" 
     56#ifdef HAVE_LIMITS_H 
     57#include <limits.h> 
     58#elif HAVE_SYS_LIMITS_H 
     59#include <sys/limits.h> 
     60#endif 
     61 
     62/* The following check for UINT_MAX is derived from Tor's torint.h. See 
     63 * the top of this file for details on Tor's license. */ 
     64#ifndef UINT_MAX 
     65#if (SIZEOF_INT == 2) 
     66#define UINT_MAX 0xffffu 
     67#elif (SIZEOF_INT == 4) 
     68#define UINT_MAX 0xffffffffu 
     69#elif (SIZEOF_INT == 8) 
     70#define UINT_MAX 0xffffffffffffffffu 
     71#else 
     72#error "Your platform uses a sizeof(int) that we don't understand." 
     73#endif 
     74#endif 
    5475 
    5576#include "zlib.h"