summaryrefslogtreecommitdiffstats
path: root/gfx/vr/service/openvr/mozilla.patch
blob: 212b5ebdd19e802c9e92162a0a923c1e5cb1f44a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
Legacy steps to update the library:

- Update the "strtools_public.h" and "strtools_public.cpp" files, commenting out
  the "Uint64ToString", "wcsncpy_s", and "strncpy_s" functions.
  The "Uint64ToString" function name conflicts with another used in Gecko and
  the "errno_t" return type returned by the other functions is not defined in
  Mozilla's macOS continuous integration build environments.  Fortunately, the
  OpenVR SDK does not use these functions.

- Replace the #define VR_INTERFACE in openvr.h to avoid extern'ing the functions.
  Unlike the usual OpenVR API builds, we are not building a separate dll.

- Add explicit in CVRSettingHelper constructor.

- In strtools_public.cpp/.h, ensure that UTF16to8 and UTF8to16 are only
  compiled under
      #if defined( _WIN32 )
  and redefine those functions to use ::WideCharToMultiByte and
  MultiByteToWideChar, respectively. These are modified because the original
  implementations contain unsupported try-catch.

- In strtools_public.cpp, remove the definition of convert_type.

- In strtools_public.cpp, remove the include of <codecvt>, as this causes
  problems in compiling on Linux.

- In pathtools_public.cpp/.h, comment out Path_UrlToFilePath and
  Path_FilePathToUrl to avoid a compile error because 'alloca' isn't defined.

- In vrpathregistry_public.cpp, CVRPathRegistry_Public::BLoadFromFile contains
  a try-catch, which is not permitted. This code is simply commented out, but
      Bug 1640068 - OpenVR code can fail JSON parsing and raise exceptions
  is filed to address a safe fallback in the error condition.

diff --git a/headers/openvr.h b/headers/openvr.h
index ec26ef41564b9..b95fb1db7e0fe 100644
--- a/headers/openvr.h
+++ b/headers/openvr.h
@@ -1932,30 +1932,33 @@ struct ImuSample_t
 
 #pragma pack( pop )
 
+#define VR_INTERFACE
+
+// Mozilla: see mozilla.patch for more details
 // figure out how to import from the VR API dll
-#if defined(_WIN32)
-
-  #if !defined(OPENVR_BUILD_STATIC)
-    #ifdef VR_API_EXPORT
-      #define VR_INTERFACE extern "C" __declspec( dllexport )
-    #else
-      #define VR_INTERFACE extern "C" __declspec( dllimport )
-    #endif
-  #else
-    #define VR_INTERFACE extern "C"
-  #endif
-
-#elif defined(__GNUC__) || defined(COMPILER_GCC) || defined(__APPLE__)
-
-#ifdef VR_API_EXPORT
-  #define VR_INTERFACE extern "C" __attribute__((visibility("default")))
-#else
-  #define VR_INTERFACE extern "C" 
-#endif
+// #if defined(_WIN32)
 
-#else
-  #error "Unsupported Platform."
-#endif
+//   #if !defined(OPENVR_BUILD_STATIC)
+//     #ifdef VR_API_EXPORT
+//       #define VR_INTERFACE extern "C" __declspec( dllexport )
+//     #else
+//       #define VR_INTERFACE extern "C" __declspec( dllimport )
+//     #endif
+//   #else
+//     #define VR_INTERFACE extern "C"
+//   #endif
+
+// #elif defined(__GNUC__) || defined(COMPILER_GCC) || defined(__APPLE__)
+
+// #ifdef VR_API_EXPORT
+//   #define VR_INTERFACE extern "C" __attribute__((visibility("default")))
+// #else
+//   #define VR_INTERFACE extern "C" 
+// #endif
+
+// #else
+//   #error "Unsupported Platform."
+// #endif
 
 
 #if defined( _WIN32 )
@@ -2557,7 +2560,8 @@ namespace vr
 	{
 		IVRSettings *m_pSettings;
 	public:
-		CVRSettingHelper( IVRSettings *pSettings ) 
+	  // Mozilla: see mozilla.patch for more details
+		explicit CVRSettingHelper( IVRSettings *pSettings ) 
 		{ 
 			m_pSettings = pSettings; 
 		}
diff --git a/src/pathtools_public.cpp b/src/pathtools_public.cpp
index eb1373a57b1a5..e7f6d6ca1bf45 100644
--- a/src/pathtools_public.cpp
+++ b/src/pathtools_public.cpp
@@ -798,52 +798,54 @@ bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const cha
 #define FILE_URL_PREFIX "file://"
 #endif
 
+// Mozilla: see mozilla.patch for more details
 // ----------------------------------------------------------------------------------------------------------------------------
 // Purpose: Turns a path to a file on disk into a URL (or just returns the value if it's already a URL)
 // ----------------------------------------------------------------------------------------------------------------------------
-std::string Path_FilePathToUrl( const std::string & sRelativePath, const std::string & sBasePath )
-{
-	if ( StringHasPrefix( sRelativePath, "http://" )
-		|| StringHasPrefix( sRelativePath, "https://" )
-		|| StringHasPrefix( sRelativePath, "vr-input-workshop://" )
-		|| StringHasPrefix( sRelativePath, "file://" )
-	   )
-	{
-		return sRelativePath;
-	}
-	else
-	{
-		std::string sAbsolute = Path_MakeAbsolute( sRelativePath, sBasePath );
-		if ( sAbsolute.empty() )
-			return sAbsolute;
-		sAbsolute = Path_FixSlashes( sAbsolute, '/' );
-
-		size_t unBufferSize = sAbsolute.length() * 3;
-		char *pchBuffer = (char *)alloca( unBufferSize );
-		V_URLEncodeFullPath( pchBuffer, (int)unBufferSize, sAbsolute.c_str(), (int)sAbsolute.length() );
-
-		return std::string( FILE_URL_PREFIX ) + pchBuffer;
-	}
-}
-
+// std::string Path_FilePathToUrl( const std::string & sRelativePath, const std::string & sBasePath )
+// {
+// 	if ( StringHasPrefix( sRelativePath, "http://" )
+// 		|| StringHasPrefix( sRelativePath, "https://" )
+// 		|| StringHasPrefix( sRelativePath, "vr-input-workshop://" )
+// 		|| StringHasPrefix( sRelativePath, "file://" )
+// 	   )
+// 	{
+// 		return sRelativePath;
+// 	}
+// 	else
+// 	{
+// 		std::string sAbsolute = Path_MakeAbsolute( sRelativePath, sBasePath );
+// 		if ( sAbsolute.empty() )
+// 			return sAbsolute;
+// 		sAbsolute = Path_FixSlashes( sAbsolute, '/' );
+
+// 		size_t unBufferSize = sAbsolute.length() * 3;
+// 		char *pchBuffer = (char *)alloca( unBufferSize );
+// 		V_URLEncodeFullPath( pchBuffer, (int)unBufferSize, sAbsolute.c_str(), (int)sAbsolute.length() );
+
+// 		return std::string( FILE_URL_PREFIX ) + pchBuffer;
+// 	}
+// }
+
+// Mozilla: see mozilla.patch for more details
 // -----------------------------------------------------------------------------------------------------
 // Purpose: Strips off file:// off a URL and returns the path. For other kinds of URLs an empty string is returned
 // -----------------------------------------------------------------------------------------------------
-std::string Path_UrlToFilePath( const std::string & sFileUrl )
-{
-	if ( !strnicmp( sFileUrl.c_str(), FILE_URL_PREFIX, strlen( FILE_URL_PREFIX ) ) )
-	{
-		char *pchBuffer = (char *)alloca( sFileUrl.length() );
-		V_URLDecodeNoPlusForSpace( pchBuffer, (int)sFileUrl.length(), 
-			sFileUrl.c_str() + strlen( FILE_URL_PREFIX ), (int)( sFileUrl.length() - strlen( FILE_URL_PREFIX ) ) );
-
-		return Path_FixSlashes( pchBuffer );
-	}
-	else
-	{
-		return "";
-	}
-}
+// std::string Path_UrlToFilePath( const std::string & sFileUrl )
+// {
+// 	if ( !strnicmp( sFileUrl.c_str(), FILE_URL_PREFIX, strlen( FILE_URL_PREFIX ) ) )
+// 	{
+// 		char *pchBuffer = (char *)alloca( sFileUrl.length() );
+// 		V_URLDecodeNoPlusForSpace( pchBuffer, (int)sFileUrl.length(), 
+// 			sFileUrl.c_str() + strlen( FILE_URL_PREFIX ), (int)( sFileUrl.length() - strlen( FILE_URL_PREFIX ) ) );
+
+// 		return Path_FixSlashes( pchBuffer );
+// 	}
+// 	else
+// 	{
+// 		return "";
+// 	}
+// }
 
 
 // -----------------------------------------------------------------------------------------------------
diff --git a/src/pathtools_public.h b/src/pathtools_public.h
index 9a120f43d6a57..33688fba2f4ad 100644
--- a/src/pathtools_public.h
+++ b/src/pathtools_public.h
@@ -98,8 +98,9 @@ std::string Path_ReadTextFile( const std::string &strFilename );
 bool Path_WriteStringToTextFile( const std::string &strFilename, const char *pchData );
 bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const char *pchData );
 
+// Mozilla: see mozilla.patch for more details
 /** Returns a file:// url for paths, or an http or https url if that's what was provided */
-std::string Path_FilePathToUrl( const std::string & sRelativePath, const std::string & sBasePath );
+// std::string Path_FilePathToUrl( const std::string & sRelativePath, const std::string & sBasePath );
 
 /** Strips off file:// off a URL and returns the path. For other kinds of URLs an empty string is returned */
 std::string Path_UrlToFilePath( const std::string & sFileUrl );
diff --git a/src/strtools_public.cpp b/src/strtools_public.cpp
index f9ce0fd5ea799..f52f8e9004982 100644
--- a/src/strtools_public.cpp
+++ b/src/strtools_public.cpp
@@ -4,11 +4,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sstream>
-#include <codecvt>
+// Mozilla: see mozilla.patch for more details
+// #include <codecvt>
 #include <iostream>
 #include <functional>
 #include <locale>
-#include <codecvt>
+// #include <codecvt>
 
 #if defined( _WIN32 )
 #include <windows.h>
@@ -57,40 +58,74 @@ bool StringHasSuffixCaseSensitive( const std::string &sString, const std::string
 //-----------------------------------------------------------------------------
 // Purpose:
 //-----------------------------------------------------------------------------
-typedef std::codecvt_utf8< wchar_t > convert_type;
+// Mozilla: see mozilla.patch for more details
+//typedef std::codecvt_utf8< wchar_t > convert_type;
 
+// Mozilla: see mozilla.patch for more details
+#if defined( _WIN32 )
 std::string UTF16to8(const wchar_t * in)
 {
-	static std::wstring_convert< convert_type, wchar_t > s_converter;  // construction of this can be expensive (or even serialized) depending on locale
-
-	try
-	{
-		return s_converter.to_bytes( in );
-	}
-	catch ( ... )
+	int retLength = ::WideCharToMultiByte(CP_UTF8, 0, in, -1, nullptr, 0, nullptr, nullptr);
+	if (retLength == 0)
 	{
 		return std::string();
 	}
+
+	char* retString = new char[retLength];
+	::WideCharToMultiByte(CP_UTF8, 0, in, -1, retString, retLength, nullptr, nullptr);
+
+	std::string retStringValue(retString);
+
+	delete[] retString;
+
+	return retStringValue;
+
+	// static std::wstring_convert< convert_type, wchar_t > s_converter;  // construction of this can be expensive (or even serialized) depending on locale
+
+	// try
+	// {
+	// 	return s_converter.to_bytes( in );
+	// }
+	// catch ( ... )
+	// {
+	// 	return std::string();
+	// }
 }
 
 std::string UTF16to8( const std::wstring & in ) { return UTF16to8( in.c_str() ); }
 
-
+// Mozilla: see mozilla.patch for more details
 std::wstring UTF8to16(const char * in)
 {
-	static std::wstring_convert< convert_type, wchar_t > s_converter;  // construction of this can be expensive (or even serialized) depending on locale
-
-	try
-	{
-		return s_converter.from_bytes( in );
-	}
-	catch ( ... )
+	int retLength = ::MultiByteToWideChar(CP_UTF8, 0, in, -1, nullptr, 0);
+	if (retLength == 0)
 	{
 		return std::wstring();
 	}
+
+	wchar_t* retString = new wchar_t[retLength];
+	::MultiByteToWideChar(CP_UTF8, 0, in, -1, retString, retLength);
+
+	std::wstring retStringValue(retString);
+
+	delete[] retString;
+
+	return retStringValue;
+
+	//static std::wstring_convert< convert_type, wchar_t > s_converter;  // construction of this can be expensive (or even serialized) depending on locale
+
+	//try
+	//{
+	//	return s_converter.from_bytes( in );
+	//}
+	//catch ( ... )
+	//{
+	//	return std::wstring();
+	//}
 }
 
 std::wstring UTF8to16( const std::string & in ) { return UTF8to16( in.c_str() ); }
+#endif
 
 
 #if defined( _WIN32 )
@@ -173,16 +208,17 @@ uint32_t ReturnStdString( const std::string & sValue, char *pchBuffer, uint32_t
 
 
 /** Returns a std::string from a uint64_t */
-std::string Uint64ToString( uint64_t ulValue )
-{
-	char buf[ 22 ];
-#if defined( _WIN32 )
-	sprintf_s( buf, "%llu", ulValue );
-#else
-    snprintf( buf, sizeof( buf ), "%llu", (long long unsigned int ) ulValue );
-#endif
-	return buf;
-}
+// Mozilla: see mozilla.patch for more details
+// std::string Uint64ToString( uint64_t ulValue )
+// {
+// 	char buf[ 22 ];
+// #if defined( _WIN32 )
+// 	sprintf_s( buf, "%llu", ulValue );
+// #else
+//     snprintf( buf, sizeof( buf ), "%llu", (long long unsigned int ) ulValue );
+// #endif
+// 	return buf;
+// }
 
 
 /** returns a uint64_t from a string */
@@ -451,84 +487,85 @@ std::vector<std::string> TokenizeString( const std::string & sString, char cToke
 	return vecStrings;
 }
 
+// Mozilla: see mozilla.patch for more details
 //-----------------------------------------------------------------------------
 // Purpose: Repairs a should-be-UTF-8 string to a for-sure-is-UTF-8 string, plus return boolean if we subbed in '?' somewhere
 //-----------------------------------------------------------------------------
-bool RepairUTF8( const char *pbegin, const char *pend, std::string & sOutputUtf8 )
-{
-	typedef std::codecvt_utf8<char32_t> facet_type;
-	facet_type myfacet;
-
-	std::mbstate_t mystate = std::mbstate_t();
-
-	sOutputUtf8.clear();
-	sOutputUtf8.reserve( pend - pbegin );
-	bool bSqueakyClean = true;
-
-	const char *pmid = pbegin;
-	while ( pmid != pend )
-	{
-		bool bHasError = false;
-		bool bHasValidData = false;
-
-		char32_t out = 0xdeadbeef, *pout;
-		pbegin = pmid;
-		switch ( myfacet.in( mystate, pbegin, pend, pmid, &out, &out + 1, pout ) )
-		{
-		case facet_type::ok:
-			bHasValidData = true;
-			break;
-
-		case facet_type::noconv:
-			// unexpected! always converting type
-			bSqueakyClean = false;
-			break;
-
-		case facet_type::partial:
-			bHasError = pbegin == pmid;
-			if ( bHasError )
-			{
-				bSqueakyClean = false;
-			}
-			else
-			{
-				bHasValidData = true;
-			}
-			break;
-
-		case facet_type::error:
-			bHasError = true;
-			bSqueakyClean = false;
-			break;
-		}
-
-		if ( bHasValidData )
-		{
-			// could convert back, but no need
-			for ( const char *p = pbegin; p != pmid; ++p )
-			{
-				sOutputUtf8 += *p;
-			}
-		}
-
-		if ( bHasError )
-		{
-			sOutputUtf8 += '?';
-		}
-
-		if ( pmid == pbegin )
-		{
-			pmid++;
-		}
-	}
-
-	return bSqueakyClean;
-}
-
-//-----------------------------------------------------------------------------
-// Purpose: Repairs a should-be-UTF-8 string to a for-sure-is-UTF-8 string, plus return boolean if we subbed in '?' somewhere
-//-----------------------------------------------------------------------------
-bool RepairUTF8( const std::string & sInputUtf8, std::string & sOutputUtf8 )
-{
-	return RepairUTF8( sInputUtf8.data(), sInputUtf8.data() + sInputUtf8.size(), sOutputUtf8 );
-}
+// bool RepairUTF8( const char *pbegin, const char *pend, std::string & sOutputUtf8 )
+// {
+// 	typedef std::codecvt_utf8<char32_t> facet_type;
+// 	facet_type myfacet;
+
+// 	std::mbstate_t mystate = std::mbstate_t();
+
+// 	sOutputUtf8.clear();
+// 	sOutputUtf8.reserve( pend - pbegin );
+// 	bool bSqueakyClean = true;
+
+// 	const char *pmid = pbegin;
+// 	while ( pmid != pend )
+// 	{
+// 		bool bHasError = false;
+// 		bool bHasValidData = false;
+
+// 		char32_t out = 0xdeadbeef, *pout;
+// 		pbegin = pmid;
+// 		switch ( myfacet.in( mystate, pbegin, pend, pmid, &out, &out + 1, pout ) )
+// 		{
+// 		case facet_type::ok:
+// 			bHasValidData = true;
+// 			break;
+
+// 		case facet_type::noconv:
+// 			// unexpected! always converting type
+// 			bSqueakyClean = false;
+// 			break;
+
+// 		case facet_type::partial:
+// 			bHasError = pbegin == pmid;
+// 			if ( bHasError )
+// 			{
+// 				bSqueakyClean = false;
+// 			}
+// 			else
+// 			{
+// 				bHasValidData = true;
+// 			}
+// 			break;
+
+// 		case facet_type::error:
+// 			bHasError = true;
+// 			bSqueakyClean = false;
+// 			break;
+// 		}
+
+// 		if ( bHasValidData )
+// 		{
+// 			// could convert back, but no need
+// 			for ( const char *p = pbegin; p != pmid; ++p )
+// 			{
+// 				sOutputUtf8 += *p;
+// 			}
+// 		}
+
+// 		if ( bHasError )
+// 		{
+// 			sOutputUtf8 += '?';
+// 		}
+
+// 		if ( pmid == pbegin )
+// 		{
+// 			pmid++;
+// 		}
+// 	}
+
+// 	return bSqueakyClean;
+// }
+
+// //-----------------------------------------------------------------------------
+// // Purpose: Repairs a should-be-UTF-8 string to a for-sure-is-UTF-8 string, plus return boolean if we subbed in '?' somewhere
+// //-----------------------------------------------------------------------------
+// bool RepairUTF8( const std::string & sInputUtf8, std::string & sOutputUtf8 )
+// {
+// 	return RepairUTF8( sInputUtf8.data(), sInputUtf8.data() + sInputUtf8.size(), sOutputUtf8 );
+// }
diff --git a/src/strtools_public.h b/src/strtools_public.h
index 349b5b38fd387..067bbe1b1b074 100644
--- a/src/strtools_public.h
+++ b/src/strtools_public.h
@@ -14,6 +14,8 @@ bool StringHasPrefixCaseSensitive( const std::string & sString, const std::strin
 bool StringHasSuffix( const std::string &sString, const std::string &sSuffix );
 bool StringHasSuffixCaseSensitive( const std::string &sString, const std::string &sSuffix );
 
+// Mozilla: see mozilla.patch for more details
+#if defined( _WIN32 )
 /** converts a UTF-16 string to a UTF-8 string */
 std::string UTF16to8( const wchar_t * in );
 std::string UTF16to8( const std::wstring & in );
@@ -22,6 +24,7 @@ std::string UTF16to8( const std::wstring & in );
 std::wstring UTF8to16(const char * in);
 std::wstring UTF8to16( const std::string & in );
 #define Utf16FromUtf8 UTF8to16
+#endif
 
 #if defined( _WIN32 )
 std::string DefaultACPtoUTF8( const char *pszStr );
@@ -69,15 +72,15 @@ inline int strnicmp( const char *pStr1, const char *pStr2, size_t unBufferLen )
 #if defined( OSX )
 // behaviors ensure NULL-termination at least as well as _TRUNCATE does, but
 // wcsncpy_s/strncpy_s can non-NULL-terminate, wcslcpy/strlcpy can not.
-inline errno_t wcsncpy_s(wchar_t *strDest, size_t numberOfElements, const wchar_t *strSource, size_t count)
-{
-	return wcslcpy(strDest, strSource, numberOfElements);
-}
+// inline errno_t wcsncpy_s(wchar_t *strDest, size_t numberOfElements, const wchar_t *strSource, size_t count)
+// {
+// 	return wcslcpy(strDest, strSource, numberOfElements);
+// }
 
-inline errno_t strncpy_s(char *strDest, size_t numberOfElements, const char *strSource, size_t count)
-{
-	return strlcpy(strDest, strSource, numberOfElements);
-}
+// inline errno_t strncpy_s(char *strDest, size_t numberOfElements, const char *strSource, size_t count)
+// {
+// 	return strlcpy(strDest, strSource, numberOfElements);
+// }
 
 #endif
 
@@ -108,7 +111,8 @@ inline uint64_t strtoull(const char *str, char **endptr, int base) { return _str
 uint32_t ReturnStdString( const std::string & sValue, char *pchBuffer, uint32_t unBufferLen );
 
 /** Returns a std::string from a uint64_t */
-std::string Uint64ToString( uint64_t ulValue );
+// Mozilla: see mozilla.patch for more details
+//std::string Uint64ToString( uint64_t ulValue );
 
 /** returns a uint64_t from a string */
 uint64_t StringToUint64( const std::string & sValue );
diff --git a/src/vrpathregistry_public.cpp b/src/vrpathregistry_public.cpp
index 6a7f457bbacf3..f40fc1cda1acd 100644
--- a/src/vrpathregistry_public.cpp
+++ b/src/vrpathregistry_public.cpp
@@ -208,7 +208,7 @@ bool CVRPathRegistry_Public::ToJsonString( std::string &sJsonString )
 	return true;
 }
 
-
+// Mozilla: see mozilla.patch for more details
 // ---------------------------------------------------------------------------
 // Purpose: Loads the config file from its well known location
 // ---------------------------------------------------------------------------
@@ -239,7 +239,8 @@ bool CVRPathRegistry_Public::BLoadFromFile( std::string *psLoadError )
 	std::istringstream istream( sRegistryContents );
 	std::string sErrors;
 
-	try {
+// try
+	{
 		if ( !parseFromStream( builder, istream, &root, &sErrors ) )
 		{
 			if ( psLoadError )
@@ -257,14 +258,14 @@ bool CVRPathRegistry_Public::BLoadFromFile( std::string *psLoadError )
 			ParseStringListFromJson( &m_vecExternalDrivers, root, "external_drivers" );
 		}
 	}
-	catch ( ... )
-	{
-		if ( psLoadError )
-		{
-			*psLoadError = "Unable to parse " + sRegPath + ": exception thrown in JSON library";
-		}
-		return false;
-	}
+// catch ( ... )
+// {
+// 	if ( psLoadError )
+// 	{
+// 		*psLoadError = "Unable to parse " + sRegPath + ": exception thrown in JSON library";
+// 	}
+// 	return false;
+// }
 
 	return true;
 }