- Added configuration checks for Solaris
[public/netxms.git] / src / libnetxms / main.cpp
1 /*
2 ** NetXMS - Network Management System
3 ** Utility Library
4 ** Copyright (C) 2003 Victor Kirhenshtein
5 **
6 ** This program is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License as published by
8 ** the Free Software Foundation; either version 2 of the License, or
9 ** (at your option) any later version.
10 **
11 ** This program is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ** GNU General Public License for more details.
15 **
16 ** You should have received a copy of the GNU General Public License
17 ** along with this program; if not, write to the Free Software
18 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 **
20 ** $module: main.cpp
21 **
22 **/
23
24 #include "libnetxms.h"
25
26
27 //
28 // Swap byte order in 64-bit integer
29 //
30
31 #if defined(_WIN32) || !defined(HAVE___BSWAP_64)
32
33 QWORD LIBNETXMS_EXPORTABLE __bswap_64(QWORD qwVal)
34 {
35 QWORD qwResult;
36 BYTE *sptr = (BYTE *)&qwVal;
37 BYTE *dptr = (BYTE *)&qwResult + 7;
38 int i;
39
40 for(i = 0; i < 8; i++, sptr++, dptr--)
41 *dptr = *sptr;
42
43 return qwResult;
44 }
45
46 #endif
47
48
49 //
50 // strupr() implementation for non-windows platforms
51 //
52
53 #ifndef _WIN32
54
55 void LIBNETXMS_EXPORTABLE strupr(char *in)
56 {
57 char *p = in;
58
59 if (in == NULL)
60 {
61 return;
62 }
63
64 for (; *p != 0; p++)
65 {
66 // TODO: check/set locale
67 *p = toupper(*p);
68 }
69 }
70
71 #endif
72
73
74 //
75 // DLL entry point
76 //
77
78 #ifdef _WIN32
79
80 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
81 {
82 return TRUE;
83 }
84
85 #endif /* _WIN32 */