Newer
Older
TIAS_Imager2 / TIAS_Imager2 / lucommon.h
#pragma once

//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//          COMMON SECTION
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
#ifdef _MSC_VER
    #if (_MSC_VER >= 1300)
        #define LUCAM_DEPRECATED   __declspec(deprecated)
    #endif
#else
    #define LUCAM_DEPRECATED
#endif


#if defined (LUMENERA_MAC_API) || defined (LUMENERA_LINUX_API)
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//          APPLICABLE TO MAC and LINUX
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************

//****************************************************************************************************************
//  Compilation Configuration Definitions
//****************************************************************************************************************
#ifndef LUCAM_EXPORT
   #define LUCAM_EXPORT
#endif

#ifdef __cplusplus
   #define LUCAM_API extern "C"  LUCAM_EXPORT
#else
   #define LUCAM_API  LUCAM_EXPORT
#endif


//****************************************************************************************************************

//****************************************************************************************************************
//  System Compatibility Definitions
//****************************************************************************************************************
#ifndef TRUE
#define TRUE    1
#endif

#ifndef FALSE
#define FALSE   0
#endif
//****************************************************************************************************************

//****************************************************************************************************************
//  Type Definitions
//****************************************************************************************************************
#include <stdint.h>
#ifdef __cplusplus
    #include <cwchar>
#else
    #include <wchar.h>
#endif //  __cplusplus

typedef uint8_t         BYTE;
typedef char            CHAR;
typedef unsigned char   UCHAR;
typedef wchar_t         WCHAR;
typedef int16_t         SHORT;
typedef uint16_t        USHORT;
typedef uint16_t        WORD;
typedef uint32_t        DWORD;
typedef int32_t         INT;
#ifdef LUMENERA_MAC_API
    #if __LP64__
        typedef unsigned int    ULONG;
        typedef signed int      LONG;
        typedef signed char     BOOL;
    #else
        #include <stdbool.h>
        typedef unsigned long   ULONG;
        typedef signed long     LONG;
        typedef bool            BOOL;
    #endif // __LP64__
#else // i.e. LUMENERA_LINUX_API
    typedef int             BOOL;
    typedef uint32_t        ULONG;
    typedef int32_t         LONG;
#endif // ifdef LUMENERA_MAC_API
typedef BOOL            BOOLEAN;
typedef int64_t         LONGLONG;
typedef uint64_t        ULONGLONG;

typedef float           FLOAT;
typedef void            VOID, *PVOID;
typedef void*           HANDLE;
typedef void*           HWND;
typedef void*           HMENU;
typedef const char*     LPCSTR;
typedef const wchar_t*  LPCWSTR;
//****************************************************************************************************************

//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************


#else
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//          WINDOWS SECTION
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************

// This definition is required for existing applications/api wrappers which will expect the Windows api to be available by default.
#ifndef LUMENERA_WINDOWS_API
#define LUMENERA_WINDOWS_API
#endif

#include <windows.h>

#ifdef LUCAMAPI_EXPORTS	// Only to be defined by Lumenera
    #ifdef _WIN64
        #ifdef __cplusplus
            #define LUCAM_API extern "C" __declspec(dllexport)
        #else
            #define LUCAM_API __declspec(dllexport)
        #endif
    #else
        #ifdef __cplusplus
            #define LUCAM_API extern "C" /*__declspec(dllexport)*/
        #else
            #define LUCAM_API /*__declspec(dllexport)*/
        #endif
    #endif
#else
    #ifdef __cplusplus
        #define LUCAM_API extern "C" __declspec(dllimport)
    #else
        #define LUCAM_API __declspec(dllimport)
    #endif
#endif

#define LUCAM_EXPORT __stdcall

//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************
//****************************************************************************************************************

#endif