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

#define DCLIB_VERSION 0x000307

#ifdef WIN32
#define VERSION "0.3.7"
#endif

#ifdef WIN32
#include <windows.h>
#include <winsock.h>
#include <wtypes.h>
#include <winbase.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

#define longlong  LONGLONG
#define ulonglong ULONGLONG
#define F_OK 0
#define R_OK 4
#define W_OK 2
#define RW_OK 6
#define socklen_t int
#define DLL_EXPORT __declspec(dllexport) //export macros
#define DLL_IMPORT __declspec(dllimport) //import macro
#define DIRSEPARATOR '\\'

#else /* !WIN32 */

typedef unsigned long long ULONGLONG;

#define ulonglong ULONGLONG
#define DLL_EXPORT
#define DLL_IMPORT
#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
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif

#ifdef WIN32
#define _ULL(x) x
#else
#define _ULL(x) x##ull
#endif

#endif
