Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / libgo / runtime / go-strcmp.c
index 8e6cb18..bcc270b 100644 (file)
@@ -4,23 +4,21 @@
    Use of this source code is governed by a BSD-style
    license that can be found in the LICENSE file.  */
 
-#include "go-string.h"
+#include "runtime.h"
 
-int
-__go_strcmp(struct __go_string s1, struct __go_string s2)
+intgo
+__go_strcmp(String s1, String s2)
 {
   int i;
 
-  i = __builtin_memcmp(s1.__data, s2.__data,
-                      (s1.__length < s2.__length
-                       ? s1.__length
-                       : s2.__length));
+  i = __builtin_memcmp(s1.str, s2.str,
+                      (s1.len < s2.len ? s1.len : s2.len));
   if (i != 0)
     return i;
 
-  if (s1.__length < s2.__length)
+  if (s1.len < s2.len)
     return -1;
-  else if (s1.__length > s2.__length)
+  else if (s1.len > s2.len)
     return 1;
   else
     return 0;