/***************************************************************************
                           dcos.h  -  description
                             -------------------
    begin                : Sat Oct 6 2001
    copyright            : (C) 2001-2005 by Mathias Küster
    email                : mathen@users.berlios.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef _OS_H_
#define _OS_H_

/* 23 in decimal is 17 in hex */
#define DCLIB_VERSION 0x000317

#define DCLIB_VERSION_STRING "0.3.23"

#define DCLIB_BUILD_INFO "Build date: 20100512 release"

#ifdef WIN32
#include <windows.h>
#include <wtypes.h>
#include <io.h>
#include <direct.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef _DEBUG
#ifndef _CRTDBG_MAP_ALLOC 
#define _CRTDBG_MAP_ALLOC 
#endif
#include <stdlib.h>
#include <crtdbg.h>
#else
#include <malloc.h>
#endif

/* same as QT4 qint64 / quint64, non gcc untested */
#if defined(_MSC_VER)
typedef __int64 longlong;
typedef unsigned __int64 ulonglong;
#else
typedef long long longlong;
typedef unsigned long long ulonglong;
#endif

#define F_OK 0
#define R_OK 4
#define W_OK 2
#define RW_OK 6
#define socklen_t int
#define DIRSEPARATOR '\\'

#else /* !WIN32 */

typedef unsigned long long ulonglong;

#define DIRSEPARATOR '/'
#endif

#ifndef SOCKET 
#define SOCKET          int 
#endif 
#ifndef INVALID_SOCKET 
#define INVALID_SOCKET  -1 
#endif 
#ifndef SOCKET_ERROR 
#define SOCKET_ERROR    -1 
#endif

/* stdint.h using exact width types is going to replace ulonglong */
#include <stdint.h>

#endif
