2012-09-20 07:51:34 +04:00
|
|
|
/**
|
|
|
|
* xrdp: A Remote Desktop Protocol server.
|
|
|
|
*
|
2013-09-10 02:20:01 +04:00
|
|
|
* Copyright (C) Jay Sorg 2004-2013
|
2012-09-20 07:51:34 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2005-01-07 03:56:38 +03:00
|
|
|
|
2005-06-28 07:04:36 +04:00
|
|
|
#if !defined(ARCH_H)
|
|
|
|
#define ARCH_H
|
|
|
|
|
2010-02-23 00:17:31 +03:00
|
|
|
#if !(defined(L_ENDIAN) || defined(B_ENDIAN))
|
2005-01-07 03:56:38 +03:00
|
|
|
/* check endianess */
|
2010-02-23 00:17:31 +03:00
|
|
|
#if defined(__sparc__) || defined(__PPC__) || defined(__ppc__) || \
|
|
|
|
defined(__hppa__)
|
2005-07-10 23:17:09 +04:00
|
|
|
#define B_ENDIAN
|
2007-12-16 12:34:59 +03:00
|
|
|
#else
|
|
|
|
#define L_ENDIAN
|
|
|
|
#endif
|
2005-01-07 03:56:38 +03:00
|
|
|
/* check if we need to align data */
|
|
|
|
#if defined(__sparc__) || defined(__alpha__) || defined(__hppa__) || \
|
|
|
|
defined(__AIX__) || defined(__PPC__) || defined(__mips__) || \
|
2009-11-05 21:21:20 +03:00
|
|
|
defined(__ia64__) || defined(__ppc__) || defined(__arm__)
|
2005-01-07 03:56:38 +03:00
|
|
|
#define NEED_ALIGN
|
|
|
|
#endif
|
2010-02-23 00:17:31 +03:00
|
|
|
#endif
|
2005-01-07 03:56:38 +03:00
|
|
|
|
2005-03-01 04:14:37 +03:00
|
|
|
/* defines for thread creation factory functions */
|
|
|
|
#if defined(_WIN32)
|
2005-01-07 03:56:38 +03:00
|
|
|
#define THREAD_RV unsigned long
|
|
|
|
#define THREAD_CC __stdcall
|
|
|
|
#else
|
|
|
|
#define THREAD_RV void*
|
|
|
|
#define THREAD_CC
|
|
|
|
#endif
|
2005-06-28 07:04:36 +04:00
|
|
|
|
2007-06-01 03:36:17 +04:00
|
|
|
#if defined(__BORLANDC__) || defined(_WIN32)
|
2005-07-02 22:38:04 +04:00
|
|
|
#define APP_CC __fastcall
|
2005-06-28 07:04:36 +04:00
|
|
|
#define DEFAULT_CC __cdecl
|
|
|
|
#else
|
|
|
|
#define APP_CC
|
|
|
|
#define DEFAULT_CC
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(_WIN32)
|
2007-06-01 03:36:17 +04:00
|
|
|
#if defined(__BORLANDC__)
|
2005-07-02 22:38:04 +04:00
|
|
|
#define EXPORT_CC _export __cdecl
|
2005-06-28 07:04:36 +04:00
|
|
|
#else
|
|
|
|
#define EXPORT_CC
|
|
|
|
#endif
|
2007-06-01 03:36:17 +04:00
|
|
|
#else
|
|
|
|
#define EXPORT_CC
|
|
|
|
#endif
|
2005-06-28 07:04:36 +04:00
|
|
|
|
2007-04-11 07:37:42 +04:00
|
|
|
typedef char ti8;
|
|
|
|
typedef unsigned char tui8;
|
|
|
|
typedef signed char tsi8;
|
|
|
|
typedef short ti16;
|
|
|
|
typedef unsigned short tui16;
|
|
|
|
typedef signed short tsi16;
|
|
|
|
typedef int ti32;
|
|
|
|
typedef unsigned int tui32;
|
|
|
|
typedef signed int tsi32;
|
2007-09-27 21:19:53 +04:00
|
|
|
#if defined(_WIN64)
|
|
|
|
/* Microsoft's VC++ compiler uses the more backwards-compatible LLP64 model.
|
|
|
|
Most other 64 bit compilers(Solaris, AIX, HP, Linux, Mac OS X) use
|
|
|
|
the LP64 model.
|
|
|
|
long is 32 bits in LLP64 model, 64 bits in LP64 model. */
|
|
|
|
typedef __int64 tbus;
|
|
|
|
#else
|
|
|
|
typedef long tbus;
|
|
|
|
#endif
|
2008-05-01 09:54:51 +04:00
|
|
|
typedef tbus thandle;
|
2009-04-20 00:03:02 +04:00
|
|
|
typedef tbus tintptr;
|
2007-12-16 13:50:58 +03:00
|
|
|
/* wide char, socket */
|
2007-12-16 13:28:16 +03:00
|
|
|
#if defined(_WIN32)
|
2007-09-27 21:19:53 +04:00
|
|
|
typedef unsigned short twchar;
|
2007-12-16 13:28:16 +03:00
|
|
|
typedef unsigned int tsock;
|
2010-07-26 07:18:03 +04:00
|
|
|
typedef unsigned __int64 tui64;
|
|
|
|
typedef signed __int64 tsi64;
|
2007-12-16 13:28:16 +03:00
|
|
|
#else
|
2007-12-16 13:50:58 +03:00
|
|
|
typedef int twchar;
|
2007-12-16 13:28:16 +03:00
|
|
|
typedef int tsock;
|
2010-07-26 07:18:03 +04:00
|
|
|
typedef unsigned long long tui64;
|
|
|
|
typedef signed long long tsi64;
|
2007-12-16 13:28:16 +03:00
|
|
|
#endif
|
2007-04-11 07:37:42 +04:00
|
|
|
|
2005-06-28 07:04:36 +04:00
|
|
|
#endif
|