$OpenBSD: patch-provider_libserver_StreamUtil_cpp,v 1.2 2011/06/02 12:46:37 ajacoutot Exp $

Needs newlocale(3).

--- provider/libserver/StreamUtil.cpp.orig	Wed Apr 20 19:51:48 2011
+++ provider/libserver/StreamUtil.cpp	Mon May  2 12:47:53 2011
@@ -280,7 +280,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;
@@ -317,7 +319,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:
@@ -334,7 +340,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:
@@ -431,7 +441,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;
@@ -448,7 +462,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;
@@ -566,7 +584,9 @@ ECRESULT SerializeDatabasePropVal(LPCSTREAMCAPS lpStre
 	}
 
 exit:
+#ifndef __OpenBSD__
 	freelocale(loc);
+#endif
 	return er;
 }
 
