Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*max@home*/
Toshihiro Shimizu 890ddd
#ifndef __GLOBAL_DEF_H__
Toshihiro Shimizu 890ddd
#define __GLOBAL_DEF_H__
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
#define GLOBAL_LOCK(P) GlobalLock(P)
Toshihiro Shimizu 890ddd
#define GLOBAL_ALLOC(T, S) GlobalAlloc(T, S)
Toshihiro Shimizu 890ddd
#define GLOBAL_FREE(P) GlobalFree(P)
Toshihiro Shimizu 890ddd
#define GLOBAL_UNLOCK(P) GlobalUnlock(P)
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
/*
Toshihiro Shimizu 890ddd
#define GLOBAL_LOCK(P)      *(P)
Toshihiro Shimizu 890ddd
//#define GLOBAL_ALLOC(T, S)  NewHandle(S)
Toshihiro Shimizu 890ddd
//#define GLOBAL_FREE(P)      DisposeHandle( (char**)P)
Toshihiro Shimizu 890ddd
#define GLOBAL_ALLOC(T, S)  (TW_HANDLE)NewPtr(S)
Toshihiro Shimizu 890ddd
#define GLOBAL_FREE(S)      DisposePtr(S)
Toshihiro Shimizu 890ddd
#define GLOBAL_UNLOCK(P)    {}
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#define GLOBAL_ALLOC(T, S) NewHandle(S)
Toshihiro Shimizu 890ddd
#define GLOBAL_FREE(P) DisposeHandle(P)
Toshihiro Shimizu 890ddd
//#define GLOBAL_ALLOC(T, S)  (TW_HANDLE)NewPtr(S)
Toshihiro Shimizu 890ddd
//#define GLOBAL_FREE(S)      DisposePtr((char*)S)
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef __cplusplus
Toshihiro Shimizu 890ddd
extern "C" {
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TW_HANDLE GLOBAL_LOCK(TW_HANDLE S);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef __cplusplus
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#define GLOBAL_UNLOCK(P) HUnlock((TW_HANDLE)P)
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
#endif /*__GLOBAL_DEF_H__*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef __cplusplus
Toshihiro Shimizu 890ddd
extern "C" {
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
void TTWAIN_ErrorBox(const char *msg);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef __cplusplus
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
#endif