1
/* ***** BEGIN LICENSE BLOCK *****
2
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
* The contents of this file are subject to the Mozilla Public License Version
5
* 1.1 (the "License"); you may not use this file except in compliance with
6
* the License. You may obtain a copy of the License at
7
* http://www.mozilla.org/MPL/
9
* Software distributed under the License is distributed on an "AS IS" basis,
10
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
* for the specific language governing rights and limitations under the
14
* The Original Code is Netscape Portable Runtime (NSPR) Tests.
16
* The Initial Developer of the Original Code is John Wolfe
17
* Portions created by the Initial Developer are Copyright (C) 2008
18
* the Initial Developer. All Rights Reserved.
22
* Alternatively, the contents of this file may be used under the terms of
23
* either the GNU General Public License Version 2 or later (the "GPL"), or
24
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
25
* in which case the provisions of the GPL or the LGPL are applicable instead
26
* of those above. If you wish to allow use of your version of this file only
27
* under the terms of either the GPL or the LGPL, and not to allow others to
28
* use your version of this file under the terms of the MPL, indicate your
29
* decision by deleting the provisions above and replace them with the notice
30
* and other provisions required by the GPL or the LGPL. If you do not delete
31
* the provisions above, a recipient may use your version of this file under
32
* the terms of any one of the MPL, the GPL or the LGPL.
34
* ***** END LICENSE BLOCK ***** */
36
#ifndef nst_wince_h___
37
#define nst_wince_h___
44
* NOTE: This file is loaded once in each test - and defines two
45
* functions for each test's eventual executable: DllMain() and
46
* nspr_test_runme() -- both exported functions.
48
* DLLs require a DllMain() entry-point.
50
* nspr_test_runme() is required so that the WinCE/WinMobile
51
* controlling test program can run each DLL's tests in a standard way.
63
* Do nothing DllMain -- needed to create a functional DLL
65
BOOL WINAPI DllMain( HANDLE hDllHandle,
69
BOOLEAN bSuccess = TRUE;
73
case DLL_PROCESS_ATTACH:
77
case DLL_THREAD_ATTACH:
81
case DLL_THREAD_DETACH:
85
case DLL_PROCESS_DETACH:
90
/* SHOULD NOT GET HERE - Do nothing */
98
/* NOW, take care of all the other main() functions out there */
99
#define main __declspec(dllexport) WINAPI nspr_test_runme
102
#define getcwd(x, nc) \
105
unsigned short dir[MAX_PATH]; \
106
GetModuleFileName(GetModuleHandle (NULL), dir, MAX_PATH); \
107
for (i = _tcslen(dir); i && dir[i] != TEXT('\\'); i--) {} \
108
dir[i + 1] = L'\0'; \
109
WideCharToMultiByte(CP_ACP, 0, dir, -1, x, nc, NULL, NULL); \
114
#endif /* nst_wince_h___ */