linuxsampler 1.0.0

global.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   LinuxSampler - modular, streaming capable sampler                     *
00004  *                                                                         *
00005  *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
00006  *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *
00007  *                                                                         *
00008  *   This program is free software; you can redistribute it and/or modify  *
00009  *   it under the terms of the GNU General Public License as published by  *
00010  *   the Free Software Foundation; either version 2 of the License, or     *
00011  *   (at your option) any later version.                                   *
00012  *                                                                         *
00013  *   This program is distributed in the hope that it will be useful,       *
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00016  *   GNU General Public License for more details.                          *
00017  *                                                                         *
00018  *   You should have received a copy of the GNU General Public License     *
00019  *   along with this program; if not, write to the Free Software           *
00020  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00021  *   MA  02111-1307  USA                                                   *
00022  ***************************************************************************/
00023 
00024 // All application global declarations that HAVE to be exposed to the C++
00025 // API are defined here.
00026 
00027 #ifndef __LS_GLOBAL_H__
00028 #define __LS_GLOBAL_H__
00029 
00030 #include <stdlib.h>
00031 #include <stdint.h>
00032 #include <stdio.h>
00033 
00034 #include <string>
00035 
00036 typedef std::string String;
00037 
00038 #if defined(WIN32)
00039 #include <windows.h>
00040 
00041 // modern MinGW has usleep
00042 #if (__MINGW32_MAJOR_VERSION < 3 ||                                     \
00043      (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15)) && \
00044     !defined(__MINGW64)
00045 #define usleep(a) Sleep(a/1000)
00046 #endif
00047 
00048 #define sleep(a) Sleep(a*1000)
00049 typedef unsigned int uint;
00050 // FIXME: define proper functions which do proper alignement under Win32
00051 #define alignedMalloc(a,b) malloc(b)
00052 #define alignedFree(a) free(a)
00053 #else
00054 // needed for usleep under POSIX
00055 #include <stdio.h>
00056 // for uint
00057 #include <sys/types.h>
00058 #endif
00059 
00060 
00061 #endif // __LS_GLOBAL_H__