/*
* EtherPix library
*
* Copyright 2010-2017 Stefan Schuermans <stefan schuermans info>
*
* 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, version 3 of the License.
*
*
* 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 Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ETP_THREAD_H
#define ETP_THREAD_H
#ifdef WINDOWS
# include <windows.h>
#else
# include <errno.h>
# include <pthread.h>
# include <sys/time.h>
# include <stdlib.h>
#endif
/** signature to define or declare thread function */
#ifdef WINDOWS
# define ETP_THREAD_FUNC(func) DWORD (__stdcall func)(LPVOID vp_displayer)
#else
# define ETP_THREAD_FUNC(func) void * (func)(void *vp_displayer)
#endif
/** return a void pointer from a thread function */
#ifdef WINDOWS
# define ETP_THREAD_RETURN(vp) return (DWORD)(vp);
#else
# define ETP_THREAD_RETURN(vp) return (vp);
#endif
/** type for a thread ID */
#ifdef WINDOWS
typedef HANDLE etp_thread_id_t;
#else
typedef pthread_t etp_thread_id_t;
#endif