[ofw] [PATCH] etc: add linux string.h compatibility code
Sean Hefty
sean.hefty at intel.com
Tue Feb 24 12:41:24 PST 2009
To support ported code, we need to map string functions to their microsoft
equivalent. Since string.h already exists, name the new header file _string.h
to avoid any naming conflict.
Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
diff -up -r -N -X trunk\docs\dontdiff.txt -I '\$Id:' trunk\inc\user/linux/_strings.h branches\winverbs\inc\user/linux/_strings.h
--- trunk\inc\user/linux/_strings.h 1969-12-31 16:00:00.000000000 -0800
+++ branches\winverbs\inc\user/linux/_strings.h 2009-02-24 12:29:38.896218100 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2009 Intel Corp, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef __STRINGS_H_
+#define __STRINGS_H_
+
+#include <string.h>
+
+#define strdup _strdup
+#define strdupa _strdup
+#define strncasecmp _strnicmp
+
+#endif /* __STRINGS_H_ */
More information about the ofw
mailing list