1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #include "chre/platform/version.h" 18 #include "chre/util/macros.h" 19 20 #ifndef CHRE_VERSION_STRING 21 #define CHRE_VERSION_STRING "undefined" 22 #endif // CHRE_VERSION_STRING 23 24 namespace chre { 25 26 //! The CHRE version string is placed in its own section so that it can be 27 //! removed before hashing to check whether there has been a change in the 28 //! compiled binary. 29 extern "C" DLL_EXPORT const char _chreVersionString[] 30 __attribute__((section(".unstable_id"))) __attribute__((aligned(8))) = 31 CHRE_VERSION_STRING; 32 getChreVersionString()33const char *getChreVersionString() { 34 return _chreVersionString; 35 } 36 37 } // namespace chre 38