Browse Source

py: Rename __QSTR_EXTRACT flag to NO_QSTR.

It has more usages than just qstr extraction, for example, embedding (where
people don't care about efficient predefined qstrs).
pull/2189/head
Paul Sokolovsky 9 years ago
parent
commit
f469c76442
  1. 2
      py/mkrules.mk
  2. 2
      py/qstr.c
  3. 2
      py/qstr.h
  4. 2
      windows/msvc/genhdr.targets

2
py/mkrules.mk

@ -49,7 +49,7 @@ $(BUILD)/%.o: %.c
# List all native flags since the current build system doesn't have # List all native flags since the current build system doesn't have
# the micropython configuration available. However, these flags are # the micropython configuration available. However, these flags are
# needed to extract all qstrings # needed to extract all qstrings
QSTR_GEN_EXTRA_CFLAGS += -D__QSTR_EXTRACT -DN_X64 -DN_X86 -DN_THUMB -DN_ARM QSTR_GEN_EXTRA_CFLAGS += -DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB -DN_ARM
QSTR_GEN_EXTRA_CFLAGS += -I$(BUILD)/tmp QSTR_GEN_EXTRA_CFLAGS += -I$(BUILD)/tmp
vpath %.c . $(TOP) vpath %.c . $(TOP)

2
py/qstr.c

@ -93,7 +93,7 @@ const qstr_pool_t mp_qstr_const_pool = {
10, // set so that the first dynamically allocated pool is twice this size; must be <= the len (just below) 10, // set so that the first dynamically allocated pool is twice this size; must be <= the len (just below)
MP_QSTRnumber_of, // corresponds to number of strings in array just below MP_QSTRnumber_of, // corresponds to number of strings in array just below
{ {
#ifndef __QSTR_EXTRACT #ifndef NO_QSTR
#define QDEF(id, str) str, #define QDEF(id, str) str,
#include "genhdr/qstrdefs.generated.h" #include "genhdr/qstrdefs.generated.h"
#undef QDEF #undef QDEF

2
py/qstr.h

@ -37,7 +37,7 @@
// first entry in enum will be MP_QSTR_NULL=0, which indicates invalid/no qstr // first entry in enum will be MP_QSTR_NULL=0, which indicates invalid/no qstr
enum { enum {
#ifndef __QSTR_EXTRACT #ifndef NO_QSTR
#define QDEF(id, str) id, #define QDEF(id, str) id,
#include "genhdr/qstrdefs.generated.h" #include "genhdr/qstrdefs.generated.h"
#undef QDEF #undef QDEF

2
windows/msvc/genhdr.targets

@ -47,7 +47,7 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
<Target Name="MakeQstrDefs" DependsOnTargets="MakeDestDir" Inputs="@(ClCompile)" Outputs="$(QstrDefsCollected)"> <Target Name="MakeQstrDefs" DependsOnTargets="MakeDestDir" Inputs="@(ClCompile)" Outputs="$(QstrDefsCollected)">
<ItemGroup> <ItemGroup>
<PyIncDirs Include="$(PyIncDirs)"/> <PyIncDirs Include="$(PyIncDirs)"/>
<PreProcDefs Include="%(ClCompile.PreProcessorDefinitions);__QSTR_EXTRACT;N_X64;N_X86;N_THUMB;N_ARM"/> <PreProcDefs Include="%(ClCompile.PreProcessorDefinitions);NO_QSTR;N_X64;N_X86;N_THUMB;N_ARM"/>
<PyQstrSourceFiles Include="@(ClCompile)"> <PyQstrSourceFiles Include="@(ClCompile)">
<OutFile>$([System.String]::new('%(FullPath)').Replace('$(PyBaseDir)', '$(DestDir)qstr\'))</OutFile> <OutFile>$([System.String]::new('%(FullPath)').Replace('$(PyBaseDir)', '$(DestDir)qstr\'))</OutFile>
</PyQstrSourceFiles> </PyQstrSourceFiles>

Loading…
Cancel
Save