Flatbuffers Merge commit '8cd6f0538a362ceefbcfcbf6c7b8b3f341d1fb41' into master
Upgrade flatbuffers to the latest.
Change-Id: I901787ac6fc5d7ce2c4019cc0d275de68086b4d8
diff --git a/third_party/flatbuffers/reflection/generate_code.sh b/third_party/flatbuffers/reflection/generate_code.sh
index 6e12c3d..b4cde5d 100755
--- a/third_party/flatbuffers/reflection/generate_code.sh
+++ b/third_party/flatbuffers/reflection/generate_code.sh
@@ -15,4 +15,18 @@
# limitations under the License.
set -e
-../../../bazel-out/host/bin/external/com_github_google_flatbuffers/flatc -c --gen-object-api --reflect-names --no-prefix -o ../include/flatbuffers reflection.fbs
+tempDir="../include/flatbuffers/.tmp"
+originalFile="../include/flatbuffers/reflection_generated.h"
+newFile="$tempDir/reflection_generated.h"
+
+../../../bazel-bin/external/com_github_google_flatbuffers/flatc -c --gen-object-api --reflect-names --cpp-std c++0x --no-prefix -o $tempDir reflection.fbs
+
+if [ -f "$newFile" ]; then
+ if ! cmp -s "$originalFile" "$newFile"; then
+ mv $newFile $originalFile
+ else
+ rm $newFile
+ fi
+ rmdir $tempDir
+fi
+