build_configuration.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. .. _embedding_build_configuration:
  2. ========================
  3. Build Configuration
  4. ========================
  5. .. _unicode:
  6. ----------
  7. Unicode
  8. ----------
  9. .. index:: single: Unicode
  10. By default Squirrel strings are plain 8-bits ASCII characters; however if the symbol
  11. 'SQUNICODE' is defined the VM, compiler and API will use 16-bit characters (UCS2).
  12. .. _squirrel_64bits:
  13. --------------------------------
  14. Squirrel on 64-bit architectures
  15. --------------------------------
  16. .. index::
  17. single: Squirrel on 64-bit architectures
  18. single: 64 bits
  19. Squirrel can be compiled on 64-bit architectures by defining '_SQ64' in the C++
  20. preprocessor. This flag should be defined in any project that includes 'squirrel.h'.
  21. .. _userdata_alignment:
  22. ------------------
  23. Userdata Alignment
  24. ------------------
  25. .. index:: single: Userdata Alignment
  26. Both class instances and userdatas can have a buffer associated to them.
  27. Squirrel specifies the alignment(in bytes) through the preprocessor defining 'SQ_ALIGNMENT'.
  28. By default SQ_ALIGNMENT is defined as 4 for 32-bit builds and 8 for 64-bit builds and builds that use 64-bit floats.
  29. It is possible to override the value of SQ_ALIGNMENT respecting the following rules.
  30. SQ_ALIGNMENT shall be less than or equal to SQ_MALLOC alignments, and it shall be power of 2.
  31. .. note:: This only applies for userdata allocated by the VM, specified via sq_setclassudsize() or belonging to a userdata object.
  32. userpointers specified by the user are not affected by alignment rules.
  33. .. _standalone_vm:
  34. ------------------------------------
  35. Stand-alone VM without compiler
  36. ------------------------------------
  37. .. index:: single: Stand-alone VM without compiler
  38. Squirrel's VM can be compiled without its compiler by defining 'NO_COMPILER' in the C++ preprocessor.
  39. When 'NO_COMPILER' is defined all function related to the compiler (eg. sq_compile) will fail. Other functions
  40. that conditionally load precompiled bytecode or compile a file (eg. sqstd_dofile) will only work with
  41. precompiled bytecode.