$OpenBSD: patch-provider_libserver_StreamUtil_cpp,v 1.4 2011/11/17 15:14:37 ajacoutot Exp $

Needs newlocale(3).

--- provider/libserver/StreamUtil.cpp.orig	Thu Nov 17 03:03:23 2011
+++ provider/libserver/StreamUtil.cpp	Thu Nov 17 13:59:31 2011
@@ -281,7 +281,9 @@ ECRESULT SerializeDatabasePropVal(LPCSTREAMCAPS lpStre
 	unsigned int ulKind;
 	unsigned int ulNameId;
 	std::string strNameString;
+#ifndef __OpenBSD__
 	locale_t loc = createlocale(LC_NUMERIC, "C");
+#endif
 	convert_context converter;
 
 	short i;
@@ -326,7 +328,11 @@ ECRESULT SerializeDatabasePropVal(LPCSTREAMCAPS lpStre
 			er = ZARAFA_E_NOT_FOUND;
 			goto exit;
 		}
+#ifndef __OpenBSD__
 		flt = (float)strtod_l(lpRow[FIELD_NR_DOUBLE], NULL, loc);
+#else
+		flt = (float)strtod(lpRow[FIELD_NR_DOUBLE], NULL);
+#endif
 		er = lpSink->Write(&flt, sizeof(flt), 1);
 		break;
 	case PT_BOOLEAN:
@@ -343,7 +349,11 @@ ECRESULT SerializeDatabasePropVal(LPCSTREAMCAPS lpStre
 			er = ZARAFA_E_NOT_FOUND;
 			goto exit;
 		}
+#ifndef __OpenBSD__
 		dbl = strtod_l(lpRow[FIELD_NR_DOUBLE], NULL, loc);
+#else
+		dbl = strtod(lpRow[FIELD_NR_DOUBLE], NULL);
+#endif
 		er = lpSink->Write(&dbl, sizeof(dbl), 1);
 		break;
 	case PT_CURRENCY:
@@ -440,7 +450,11 @@ ECRESULT SerializeDatabasePropVal(LPCSTREAMCAPS lpStre
 		for (unsigned x = 0; er == erSuccess && x < ulCount; x++)
 		{
 			ParseMVProp(lpRow[FIELD_NR_DOUBLE], lpLen[FIELD_NR_DOUBLE], &ulLastPos, &strData);
+#ifndef __OpenBSD__
 			flt = (float)strtod_l(strData.c_str(), NULL, loc);
+#else
+			flt = (float)strtod(strData.c_str(), NULL);
+#endif
 			er = lpSink->Write(&flt, sizeof(flt), 1);
 		}
 		break;
@@ -457,7 +471,11 @@ ECRESULT SerializeDatabasePropVal(LPCSTREAMCAPS lpStre
 		for (unsigned x = 0; er == erSuccess && x < ulCount; x++)
 		{
 			ParseMVProp(lpRow[FIELD_NR_DOUBLE], lpLen[FIELD_NR_DOUBLE], &ulLastPos, &strData);
+#ifndef __OpenBSD__
 			dbl = strtod_l(strData.c_str(), NULL, loc);
+#else
+			dbl = strtod(strData.c_str(), NULL);
+#endif
 			er = lpSink->Write(&dbl, sizeof(flt), 1);
 		}
 		break;
@@ -575,7 +593,9 @@ ECRESULT SerializeDatabasePropVal(LPCSTREAMCAPS lpStre
 	}
 
 exit:
+#ifndef __OpenBSD__
 	freelocale(loc);
+#endif
 	return er;
 }
 
