~ubuntu-branches/ubuntu/saucy/nspr/saucy-updates

« back to all changes in this revision

Viewing changes to mozilla/nsprpub/pr/tests/nst_wince.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2009-08-10 11:34:26 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090810113426-3uv4diflrkcbdimm
Tags: 4.8-0ubuntu1
* New upstream release: 4.8 (LP: #387812)
* adjust patches to changed upstreanm codebase
  - update debian/patches/99_configure.patch
* update shlibs symbols to include new API elements
  - update debian/libnspr4-0d.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ***** BEGIN LICENSE BLOCK *****
 
2
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
3
 *
 
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/
 
8
 *
 
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
 
12
 * License.
 
13
 *
 
14
 * The Original Code is Netscape Portable Runtime (NSPR) Tests.
 
15
 *
 
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.
 
19
 *
 
20
 * Contributor(s):
 
21
 *
 
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.
 
33
 *
 
34
 * ***** END LICENSE BLOCK ***** */
 
35
 
 
36
#ifndef nst_wince_h___
 
37
#define nst_wince_h___
 
38
 
 
39
#ifndef __WINDOWS__
 
40
#include <windows.h>
 
41
#endif
 
42
 
 
43
/***********
 
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.
 
47
 *
 
48
 * DLLs require a DllMain() entry-point.
 
49
 *
 
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.
 
52
 ***********/
 
53
 
 
54
#ifdef WINCE
 
55
 
 
56
#ifdef perror
 
57
#undef perror
 
58
#endif
 
59
#define perror(x)
 
60
 
 
61
 
 
62
/***********
 
63
 * Do nothing DllMain -- needed to create a functional DLL
 
64
 ***********/
 
65
BOOL WINAPI DllMain( HANDLE hDllHandle,
 
66
                     DWORD  nReason,
 
67
                     LPVOID lpvReserved )
 
68
{
 
69
  BOOLEAN bSuccess = TRUE;
 
70
 
 
71
  switch ( nReason )
 
72
  {
 
73
    case DLL_PROCESS_ATTACH:
 
74
      /* Do nothing yet  */
 
75
      break;
 
76
 
 
77
    case DLL_THREAD_ATTACH:
 
78
      /* Do nothing yet  */
 
79
      break;
 
80
 
 
81
    case DLL_THREAD_DETACH:
 
82
      /* Do nothing yet  */
 
83
      break;
 
84
 
 
85
    case DLL_PROCESS_DETACH:
 
86
      /* Do nothing yet  */
 
87
      break;
 
88
 
 
89
    default:
 
90
      /* SHOULD NOT GET HERE - Do nothing  */
 
91
      break;
 
92
  }
 
93
 
 
94
  return bSuccess;
 
95
}
 
96
/*  end DllMain   */
 
97
 
 
98
/* NOW, take care of all the other main() functions out there */
 
99
#define main __declspec(dllexport) WINAPI nspr_test_runme
 
100
 
 
101
#undef getcwd
 
102
#define getcwd(x, nc) \
 
103
{ \
 
104
  int i; \
 
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); \
 
110
}
 
111
 
 
112
#endif  /* WINCE */
 
113
 
 
114
#endif /* nst_wince_h___ */