mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
Merge branch 'master' into ts-type-improvements
This commit is contained in:
@@ -57,7 +57,7 @@ a `char *` array, which you pass to `GetMonster()`.
|
|||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include "flatbuffers/flatbuffers.h"
|
#include "flatbuffers/flatbuffers.h"
|
||||||
#include "monster_test_generate.h"
|
#include "monster_test_generated.h"
|
||||||
#include <iostream> // C++ header file for printing
|
#include <iostream> // C++ header file for printing
|
||||||
#include <fstream> // C++ header file for file access
|
#include <fstream> // C++ header file for file access
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,26 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
import shutil
|
||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
|
|
||||||
|
_THIS_DIR = Path(__file__).resolve().parent
|
||||||
|
_ROOT_LICENSE = _THIS_DIR.parent / 'LICENSE'
|
||||||
|
_LOCAL_LICENSE = _THIS_DIR / 'LICENSE'
|
||||||
|
|
||||||
|
|
||||||
|
def _stage_license_file():
|
||||||
|
if _LOCAL_LICENSE.exists() or not _ROOT_LICENSE.exists():
|
||||||
|
return False
|
||||||
|
shutil.copyfile(_ROOT_LICENSE, _LOCAL_LICENSE)
|
||||||
|
return True
|
||||||
|
|
||||||
|
_remove_staged_license = _stage_license_file()
|
||||||
|
|
||||||
|
try:
|
||||||
setup(
|
setup(
|
||||||
name='flatbuffers',
|
name='flatbuffers',
|
||||||
version='25.12.19',
|
version='25.12.19',
|
||||||
@@ -42,3 +60,6 @@ setup(
|
|||||||
'Source': 'https://github.com/google/flatbuffers',
|
'Source': 'https://github.com/google/flatbuffers',
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
finally:
|
||||||
|
if _remove_staged_license and _LOCAL_LICENSE.exists():
|
||||||
|
_LOCAL_LICENSE.unlink()
|
||||||
|
|||||||
@@ -2471,7 +2471,7 @@ class PythonGenerator : public BaseGenerator {
|
|||||||
} else {
|
} else {
|
||||||
GenPackForScalarVectorFieldHelper(struct_def, field, code_prefix_ptr, 3);
|
GenPackForScalarVectorFieldHelper(struct_def, field, code_prefix_ptr, 3);
|
||||||
code_prefix += "(self." + field_field + "[i])";
|
code_prefix += "(self." + field_field + "[i])";
|
||||||
code_prefix += GenIndents(4) + field_field + " = builder.EndVector()";
|
code_prefix += GenIndents(3) + field_field + " = builder.EndVector()";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user