Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style license that can be | |
| 4 * found in the LICENSE file. | |
| 5 */ | |
| 6 | |
| 7 #include <stdio.h> | |
| 8 #include <stdlib.h> | |
| 9 | |
| 10 #include "native_client/src/trusted/validator/ncvalidate.h" | |
| 11 | |
| 12 int NaClUseDfaValidator() { | |
|
Mark Seaborn
2012/06/20 20:02:26
This function can be declared static
pasko-google - do not use
2012/06/21 15:24:18
That produces an error on ARM: defined but not use
| |
| 13 if (getenv("NACL_DANGEROUS_USE_DFA_VALIDATOR") != NULL) { | |
| 14 return 1; | |
| 15 } | |
| 16 return 0; | |
| 17 } | |
| 18 | |
| 19 const struct NaClValidatorInterface* NaClCreateValidator() { | |
| 20 #if defined(__arm__) | |
|
Mark Seaborn
2012/06/20 20:02:26
Use NACL_ARCH() again instead of __arm__
pasko-google - do not use
2012/06/21 15:24:18
Done.
| |
| 21 return NaClValidatorCreateArm(); | |
| 22 #elif NACL_ARCH(NACL_TARGET_ARCH) != NACL_x86 | |
| 23 #error("No validator available for this architecture!") | |
|
Mark Seaborn
2012/06/20 20:02:26
No brackets are needed here
pasko-google - do not use
2012/06/21 15:24:18
Done.
| |
| 24 #elif NACL_TARGET_SUBARCH == 32 && defined(NACL_STANDALONE) | |
| 25 if (NaClUseDfaValidator()) { | |
| 26 fprintf(stderr, "DANGER! USING THE EXPERIMENTAL DFA VALIDATOR!\n"); | |
|
Mark Seaborn
2012/06/20 20:02:26
Please use NaClLog with LOG_WARNING instead of fpr
pasko-google - do not use
2012/06/21 15:24:18
Done.
| |
| 27 return NaClDfaValidatorCreate_x86_32(); | |
| 28 } else { | |
| 29 return NaClValidatorCreate_x86_32(); | |
| 30 } | |
| 31 #elif NACL_TARGET_SUBARCH == 32 | |
| 32 return NaClValidatorCreate_x86_32(); | |
| 33 #elif NACL_TARGET_SUBARCH == 64 && defined(NACL_STANDALONE) | |
| 34 if (NaClUseDfaValidator()) { | |
| 35 fprintf(stderr, "DANGER! USING THE EXPERIMENTAL DFA VALIDATOR!\n"); | |
| 36 return NaClDfaValidatorCreate_x86_64(); | |
| 37 } else { | |
| 38 return NaClValidatorCreate_x86_64(); | |
| 39 } | |
| 40 #elif NACL_TARGET_SUBARCH == 64 | |
| 41 return NaClValidatorCreate_x86_64(); | |
| 42 #endif | |
| 43 } | |
| OLD | NEW |