~ubuntu-branches/ubuntu/oneiric/enigmail/oneiric-updates

« back to all changes in this revision

Viewing changes to build/wince/shunt/include/mozce_shunt.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2010-04-10 01:42:24 UTC
  • Revision ID: james.westby@ubuntu.com-20100410014224-fbq9ui5x3b0h2t36
Tags: 2:1.0.1-0ubuntu1
* First releaase of enigmail 1.0.1 for tbird/icedove 3
  (LP: #527138)
* redo packaging from scratch 
  + add debian/make-orig target that uses xulrunner provided
    buildsystem + enigmail tarball to produce a proper orig.tar.gz
  + use debhelper 7 with mozilla-devscripts
  + use debian source format 3.0 (quilt)
  + patch enigmail to use frozen API only
    - add debian/patches/frozen_api.diff
  + patch build system to not link against -lxul - which isnt
    available for sdks produced by all-static apps like tbird
    - add debian/patches/build_system_dont_link_libxul.diff
  + add minimal build-depends to control

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 MOZCE Lib.
 
15
 *
 
16
 * The Initial Developer of the Original Code is Doug Turner <dougt@meer.net>.
 
17
 
 
18
 * Portions created by the Initial Developer are Copyright (C) 2005
 
19
 * the Initial Developer. All Rights Reserved.
 
20
 *
 
21
 * Contributor(s):
 
22
 *  John Wolfe <wolfe@lobo.us>
 
23
 *
 
24
 * Alternatively, the contents of this file may be used under the terms of
 
25
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
26
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
27
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
28
 * of those above. If you wish to allow use of your version of this file only
 
29
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
30
 * use your version of this file under the terms of the MPL, indicate your
 
31
 * decision by deleting the provisions above and replace them with the notice
 
32
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
33
 * the provisions above, a recipient may use your version of this file under
 
34
 * the terms of any one of the MPL, the GPL or the LGPL.
 
35
 *
 
36
 * ***** END LICENSE BLOCK ***** */
 
37
 
 
38
#ifndef MOZCE_SHUNT_H
 
39
#define MOZCE_SHUNT_H
 
40
 
 
41
#include "environment.h"
 
42
 
 
43
#ifdef __cplusplus
 
44
extern "C" {
 
45
#endif
 
46
 
 
47
#ifndef _WCHAR_T_DEFINED
 
48
typedef unsigned short wchar_t;
 
49
#define _WCHAR_T_DEFINED
 
50
#endif
 
51
 
 
52
#ifdef __cplusplus
 
53
}   //extern "C" 
 
54
#endif
 
55
 
 
56
#ifdef MOZ_MEMORY
 
57
 
 
58
#ifdef __cplusplus
 
59
 
 
60
// define these so we don't include <new> from either VC or
 
61
// the CE5 SDK
 
62
#define _NEW_
 
63
#define _INC_NEW
 
64
 
 
65
#ifndef __NOTHROW_T_DEFINED
 
66
#define __NOTHROW_T_DEFINED
 
67
namespace std {
 
68
  struct nothrow_t {};
 
69
  extern const nothrow_t nothrow;
 
70
};
 
71
#endif
 
72
 
 
73
// grab malloc and free prototypes
 
74
#include "jemalloc.h"
 
75
 
 
76
// Normal and nothrow versions of operator new, none of which
 
77
// actually throw for us.  These are both inline and exported
 
78
// from the shunt.
 
79
inline void *operator new(size_t size) throw() {
 
80
  return (void*) malloc(size);
 
81
}
 
82
inline void *operator new(size_t size, const std::nothrow_t&) throw() {
 
83
  return (void*) malloc(size);
 
84
}
 
85
inline void operator delete(void *ptr) throw() {
 
86
  free(ptr);
 
87
}
 
88
inline void *operator new[](size_t size) throw() {
 
89
  return (void*) malloc(size);
 
90
}
 
91
inline void *operator new[](size_t size, const std::nothrow_t&) throw() {
 
92
  return (void*) malloc(size);
 
93
}
 
94
inline void operator delete[](void *ptr) throw() {
 
95
  return free(ptr);
 
96
}
 
97
 
 
98
// Placement new.  Just inline, not exported (which doesn't work for
 
99
// some reason, but it's a noop in any case)
 
100
inline void *operator new(size_t, void *p) {
 
101
  return p;
 
102
}
 
103
inline void *operator new[](size_t, void *p) {
 
104
  return p;
 
105
}
 
106
 
 
107
extern "C" {
 
108
#endif
 
109
 
 
110
#undef _strdup
 
111
#undef strdup
 
112
#undef _strndup
 
113
#undef strndup
 
114
#undef _wcsdup
 
115
#undef wcsdup
 
116
#undef _wcsndup
 
117
#undef wcsndup
 
118
 
 
119
char * __cdecl
 
120
_strdup(const char*);
 
121
 
 
122
wchar_t * __cdecl
 
123
_wcsdup(const wchar_t *);
 
124
 
 
125
char * __cdecl
 
126
_strndup(const char *, unsigned int);
 
127
 
 
128
wchar_t * __cdecl
 
129
_wcsndup(const wchar_t *, unsigned int);
 
130
  
 
131
#ifdef __cplusplus
 
132
}   //extern "C" 
 
133
#endif
 
134
 
 
135
#endif
 
136
 
 
137
#define strdup  _strdup
 
138
#define strndup _strndup
 
139
#define wcsdup _wcsdup
 
140
#define wcsndup _wcsndup
 
141
 
 
142
 
 
143
#define strcmpi _stricmp
 
144
#define stricmp _stricmp
 
145
#define wgetcwd _wgetcwd
 
146
#define vsnprintf _vsnprintf
 
147
 
 
148
#define SHGetSpecialFolderPathW SHGetSpecialFolderPath
 
149
#define SHGetPathFromIDListW    SHGetPathFromIDList
 
150
#define FONTENUMPROCW           FONTENUMPROC
 
151
 
 
152
#ifdef __cplusplus
 
153
extern "C" {
 
154
#endif
 
155
 
 
156
/* errno and family */
 
157
extern int errno;
 
158
char* strerror(int);
 
159
 
 
160
/* abort */
 
161
void abort(void);
 
162
  
 
163
/* Environment stuff */
 
164
char* getenv(const char* inName);
 
165
int putenv(const char *a);
 
166
char SetEnvironmentVariableW(const unsigned short * name, const unsigned short * value );
 
167
char GetEnvironmentVariableW(const unsigned short * lpName, unsigned short* lpBuffer, unsigned long nSize);
 
168
  
 
169
unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
 
170
                                       unsigned short* lpDst,
 
171
                                       unsigned int nSize);
 
172
 
 
173
/* File system stuff */
 
174
unsigned short * _wgetcwd(unsigned short* dir, unsigned long size);
 
175
unsigned short *_wfullpath( unsigned short *absPath, const unsigned short *relPath, unsigned long maxLength );
 
176
int _unlink(const char *filename );
 
177
int _wchdir(const unsigned short* path);
 
178
  
 
179
/* The time stuff should be defined here, but it can't be because it
 
180
   is already defined in time.h.
 
181
  
 
182
 size_t strftime(char *, size_t, const char *, const struct tm *)
 
183
 struct tm* localtime(const time_t* inTimeT)
 
184
 struct tm* mozce_gmtime_r(const time_t* inTimeT, struct tm* outRetval)
 
185
 struct tm* gmtime(const time_t* inTimeT)
 
186
 time_t mktime(struct tm* inTM)
 
187
 time_t time(time_t *)
 
188
 clock_t clock() 
 
189
  
 
190
*/
 
191
 
 
192
struct tm;
 
193
 
 
194
#ifndef _TIME_T_DEFINED
 
195
typedef long time_t;
 
196
#define _TIME_T_DEFINED
 
197
#endif
 
198
 
 
199
struct tm* gmtime_r(const time_t* inTimeT, struct tm* outRetval);
 
200
struct tm* localtime_r(const time_t* inTimeT, struct tm* outRetval);
 
201
 
 
202
/* Locale Stuff */
 
203
  
 
204
/* The locale stuff should be defined here, but it can't be because it
 
205
   is already defined in locale.h.
 
206
  
 
207
 struct lconv * localeconv(void)
 
208
  
 
209
*/
 
210
 
 
211
 
 
212
unsigned short* mozce_GetEnvironmentCL();
 
213
 
 
214
  /* square root of 1/2, missing from math.h */ 
 
215
#define M_SQRT1_2  0.707106781186547524401
 
216
 
 
217
#ifdef __cplusplus
 
218
};
 
219
#endif
 
220
 
 
221
#endif //MOZCE_SHUNT_H