Implement one-definition-rule (ODR) feature.
When compiling multiple RS files, we say two RS files A and B break ODR
iff:
1. They have at least one common struct named [S] and [S] will be reflected
to ScriptField_[S].java, and
2. [S] defined in A is not *exactly the same* (number of fields, field
type and field name) as the one defined in B.
This CL detects such error.
diff --git a/slang_rs_exportable.cpp b/slang_rs_exportable.cpp
new file mode 100644
index 0000000..53ab33d
--- /dev/null
+++ b/slang_rs_exportable.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2010, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "slang_rs_exportable.h"
+
+using namespace slang;
+
+void RSExportable::keep() {
+ // Invalidate associated Context.
+ mContext = NULL;
+ return;
+}
+
+bool RSExportable::equals(const RSExportable *E) const {
+ return ((E == NULL) ? false : (mK == E->mK));
+}