2006-02-17 13:35:04 +00:00
|
|
|
/* <!-- copyright */
|
|
|
|
/*
|
2006-09-21 15:31:24 +00:00
|
|
|
* aria2 - The high speed download utility
|
2006-02-17 13:35:04 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Tatsuhiro Tsujikawa
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2010-01-05 16:01:46 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2006-09-21 15:31:24 +00:00
|
|
|
*
|
|
|
|
* In addition, as a special exception, the copyright holders give
|
|
|
|
* permission to link the code of portions of this program with the
|
|
|
|
* OpenSSL library under certain conditions as described in each
|
|
|
|
* individual source file, and distribute linked combinations
|
|
|
|
* including the two.
|
|
|
|
* You must obey the GNU General Public License in all respects
|
|
|
|
* for all of the code used other than OpenSSL. If you modify
|
|
|
|
* file(s) with this exception, you may extend this exception to your
|
|
|
|
* version of the file(s), but you are not obligated to do so. If you
|
|
|
|
* do not wish to do so, delete this exception statement from your
|
|
|
|
* version. If you delete this exception statement from all source
|
|
|
|
* files in the program, then also delete it here.
|
2006-02-17 13:35:04 +00:00
|
|
|
*/
|
|
|
|
/* copyright --> */
|
2010-10-31 07:23:53 +00:00
|
|
|
#ifndef D_COMMON_H
|
|
|
|
#define D_COMMON_H
|
2008-02-08 15:53:45 +00:00
|
|
|
|
2008-03-03 15:41:58 +00:00
|
|
|
#ifdef __MINGW32__
|
|
|
|
# undef SIZE_MAX
|
2008-06-16 13:18:26 +00:00
|
|
|
# ifndef _OFF_T_
|
|
|
|
# define _OFF_T_
|
2010-01-05 16:01:46 +00:00
|
|
|
typedef long long _off_t;
|
2008-06-16 13:18:26 +00:00
|
|
|
# ifndef _NO_OLDNAMES
|
2010-01-05 16:01:46 +00:00
|
|
|
typedef _off_t off_t;
|
2008-06-16 13:18:26 +00:00
|
|
|
# endif // !_NO_OLDNAMES
|
2010-01-05 16:01:46 +00:00
|
|
|
# endif // !_OFF_T_
|
2008-03-03 15:41:58 +00:00
|
|
|
#endif // __MINGW32__
|
|
|
|
|
2006-03-05 06:32:01 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2008-02-02 04:38:24 +00:00
|
|
|
# include "config.h"
|
2006-03-05 06:32:01 +00:00
|
|
|
#endif
|
2007-07-31 16:45:16 +00:00
|
|
|
|
|
|
|
#ifdef __MINGW32__
|
|
|
|
#ifdef malloc
|
2010-01-05 16:01:46 +00:00
|
|
|
# undef malloc
|
2007-07-31 16:45:16 +00:00
|
|
|
#endif
|
|
|
|
#ifdef realloc
|
2010-01-05 16:01:46 +00:00
|
|
|
# undef realloc
|
2007-07-31 16:45:16 +00:00
|
|
|
#endif
|
|
|
|
#endif // __MINGW32__
|
|
|
|
|
2011-08-09 15:38:48 +00:00
|
|
|
#ifdef __MINGW32__
|
|
|
|
# define WIN32_LEAN_AND_MEAN
|
|
|
|
# ifndef WINVER
|
|
|
|
# define WINVER 0x501u
|
|
|
|
# endif // WINVER
|
|
|
|
# include <windows.h>
|
|
|
|
#endif // __MINGW32__
|
|
|
|
|
2008-03-08 07:53:16 +00:00
|
|
|
#ifdef ENABLE_NLS
|
2010-12-15 13:33:26 +00:00
|
|
|
// If we put #include <gettext.h> outside of #ifdef ENABLE_NLS and
|
|
|
|
// --disable-nls is used, gettext(msgid) is defined as ((const char *)
|
|
|
|
// (Msgid)). System header includes libintl.h regardless of
|
|
|
|
// --disable-nls. For example, #include <string> will include
|
|
|
|
// libintl.h through include chain. Since libintl.h refers gettext and
|
|
|
|
// it is defined as non-function form, this causes compile error. User
|
|
|
|
// reported gcc-4.2.2 has this problem. But gcc-4.4.5 does not suffer
|
|
|
|
// from this problem.
|
|
|
|
# include <gettext.h>
|
2008-03-08 07:53:16 +00:00
|
|
|
# define _(String) gettext(String)
|
|
|
|
#else // ENABLE_NLS
|
|
|
|
# define _(String) String
|
|
|
|
#endif
|
2006-02-17 13:35:04 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
// use C99 limit macros
|
|
|
|
#define __STDC_LIMIT_MACROS
|
2008-06-06 14:02:33 +00:00
|
|
|
// included here for compatibility issues with old compiler/libraries.
|
|
|
|
#include <stdint.h>
|
2007-07-23 13:04:48 +00:00
|
|
|
|
2010-10-31 07:23:53 +00:00
|
|
|
#endif // D_COMMON_H
|