SRB2/src/hardware/hw_dll.h

70 lines
2 KiB
C
Raw Normal View History

2020-01-23 23:12:15 +00:00
// SONIC ROBO BLAST 2
2014-03-15 16:59:03 +00:00
//-----------------------------------------------------------------------------
2020-01-23 23:12:15 +00:00
// Copyright (C) 2005 by Sonic Team Junior.
2014-03-15 16:59:03 +00:00
//
2020-01-23 23:12:15 +00:00
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
2014-03-15 16:59:03 +00:00
//-----------------------------------------------------------------------------
2020-01-23 23:12:15 +00:00
/// \file hw_dll.h
2014-03-15 16:59:03 +00:00
/// \brief Win32 DLL and Shared Objects API definitions
#ifndef __HWR_DLL_H__
#define __HWR_DLL_H__
// Function declaration for exports from the DLL :
// EXPORT <return-type> HWRAPI(<function-name>) (<arguments>);
// If _CREATE_DLL_ is defined the above declaration translates to :
// __declspec(dllexport) <return-type> WINAPI <function-name> (<arguments>);
// If _CREATE_DLL_ is NOT DEFINED the above declaration translates to :
// __declspec(dllexport) <return->type> (WINAPI *<function-name>) (<arguments>);
#ifdef _CREATE_DLL_
#ifdef _WINDOWS
#ifdef __cplusplus
#define EXPORT extern "C" __declspec(dllexport)
#else
#define EXPORT __declspec(dllexport)
#endif
#else
#ifdef __cplusplus
#define EXPORT extern "C"
#else
#define EXPORT
#endif
#endif
2017-09-29 18:27:17 +00:00
#ifdef _WIN32
2014-03-15 16:59:03 +00:00
#define HWRAPI(fn) WINAPI fn
#else
#define HWRAPI(fn) fn
#endif
#else // _CREATE_DLL_
#define EXPORT typedef
2017-09-29 18:27:17 +00:00
#ifdef _WIN32
2014-03-15 16:59:03 +00:00
#define HWRAPI(fn) (WINAPI *fn)
#else
#define HWRAPI(fn) (*fn)
#endif
#endif
// ==========================================================================
// MATHS
// ==========================================================================
// Constants
#define DEGREE (0.017453292519943295769236907684883l) // 2*PI/360
void GL_DBG_Printf(const char *format, ...) /*FUNCPRINTF*/;
2014-03-15 16:59:03 +00:00
#ifdef _WINDOWS
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
#elif defined (__CYGWIN__)
void _init() __attribute__((constructor));
void _fini() __attribute__((destructor));
#else
void _init();
void _fini();
#endif
#endif