| OLD | NEW |
| 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 * | 4 * |
| 5 * Stub implementations of utility functions which call their linux-specific | 5 * Stub implementations of utility functions which call their linux-specific |
| 6 * equivalents. | 6 * equivalents. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #define _STUB_IMPLEMENTATION_ | 9 #define _STUB_IMPLEMENTATION_ |
| 10 #include "utility.h" | 10 #include "utility.h" |
| 11 | 11 |
| 12 #include <stdarg.h> | 12 #include <stdarg.h> |
| 13 #include <stdio.h> | 13 #include <stdio.h> |
| 14 #include <stdlib.h> | 14 #include <stdlib.h> |
| 15 #include <string.h> |
| 15 | 16 |
| 16 void error(const char *format, ...) { | 17 void error(const char *format, ...) { |
| 17 va_list ap; | 18 va_list ap; |
| 18 va_start(ap, format); | 19 va_start(ap, format); |
| 19 fprintf(stderr, "ERROR: "); | 20 fprintf(stderr, "ERROR: "); |
| 20 vfprintf(stderr, format, ap); | 21 vfprintf(stderr, format, ap); |
| 21 va_end(ap); | 22 va_end(ap); |
| 22 exit(1); | 23 exit(1); |
| 23 } | 24 } |
| 24 | 25 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 int match = 0; | 63 int match = 0; |
| 63 const unsigned char* us1 = s1; | 64 const unsigned char* us1 = s1; |
| 64 const unsigned char* us2 = s2; | 65 const unsigned char* us2 = s2; |
| 65 while (n--) { | 66 while (n--) { |
| 66 if (*us1++ != *us2++) | 67 if (*us1++ != *us2++) |
| 67 match = 1; | 68 match = 1; |
| 68 } | 69 } |
| 69 | 70 |
| 70 return match; | 71 return match; |
| 71 } | 72 } |
| OLD | NEW |