static void init_code_range_array(void) {
  THREAD_ATOMIC_START;

  CodeRanges[0] = CR_NEWLINE;
  CodeRanges[1] = CR_Alpha;
  CodeRanges[2] = CR_Blank;
  CodeRanges[3] = CR_Cntrl;
  CodeRanges[4] = CR_Digit;
  CodeRanges[5] = CR_Graph;
  CodeRanges[6] = CR_Lower;
  CodeRanges[7] = CR_Print;
  CodeRanges[8] = CR_Punct;
  CodeRanges[9] = CR_Space;
  CodeRanges[10] = CR_Upper;
  CodeRanges[11] = CR_XDigit;
  CodeRanges[12] = CR_Word;
  CodeRanges[13] = CR_Alnum;
  CodeRanges[14] = CR_ASCII;

#ifdef USE_UNICODE_PROPERTIES
  CodeRanges[15] = CR_Any;
  CodeRanges[16] = CR_Assigned;
  CodeRanges[17] = CR_C;
  CodeRanges[18] = CR_Cc;
  CodeRanges[19] = CR_Cf;
  CodeRanges[20] = CR_Cn;
  CodeRanges[21] = CR_Co;
  CodeRanges[22] = CR_Cs;
  CodeRanges[23] = CR_L;
  CodeRanges[24] = CR_Ll;
  CodeRanges[25] = CR_Lm;
  CodeRanges[26] = CR_Lo;
  CodeRanges[27] = CR_Lt;
  CodeRanges[28] = CR_Lu;
  CodeRanges[29] = CR_M;
  CodeRanges[30] = CR_Mc;
  CodeRanges[31] = CR_Me;
  CodeRanges[32] = CR_Mn;
  CodeRanges[33] = CR_N;
  CodeRanges[34] = CR_Nd;
  CodeRanges[35] = CR_Nl;
  CodeRanges[36] = CR_No;
  CodeRanges[37] = CR_P;
  CodeRanges[38] = CR_Pc;
  CodeRanges[39] = CR_Pd;
  CodeRanges[40] = CR_Pe;
  CodeRanges[41] = CR_Pf;
  CodeRanges[42] = CR_Pi;
  CodeRanges[43] = CR_Po;
  CodeRanges[44] = CR_Ps;
  CodeRanges[45] = CR_S;
  CodeRanges[46] = CR_Sc;
  CodeRanges[47] = CR_Sk;
  CodeRanges[48] = CR_Sm;
  CodeRanges[49] = CR_So;
  CodeRanges[50] = CR_Z;
  CodeRanges[51] = CR_Zl;
  CodeRanges[52] = CR_Zp;
  CodeRanges[53] = CR_Zs;
  CodeRanges[54] = CR_Arabic;
  CodeRanges[55] = CR_Armenian;
  CodeRanges[56] = CR_Bengali;
  CodeRanges[57] = CR_Bopomofo;
  CodeRanges[58] = CR_Braille;
  CodeRanges[59] = CR_Buginese;
  CodeRanges[60] = CR_Buhid;
  CodeRanges[61] = CR_Canadian_Aboriginal;
  CodeRanges[62] = CR_Cherokee;
  CodeRanges[63] = CR_Common;
  CodeRanges[64] = CR_Coptic;
  CodeRanges[65] = CR_Cypriot;
  CodeRanges[66] = CR_Cyrillic;
  CodeRanges[67] = CR_Deseret;
  CodeRanges[68] = CR_Devanagari;
  CodeRanges[69] = CR_Ethiopic;
  CodeRanges[70] = CR_Georgian;
  CodeRanges[71] = CR_Glagolitic;
  CodeRanges[72] = CR_Gothic;
  CodeRanges[73] = CR_Greek;
  CodeRanges[74] = CR_Gujarati;
  CodeRanges[75] = CR_Gurmukhi;
  CodeRanges[76] = CR_Han;
  CodeRanges[77] = CR_Hangul;
  CodeRanges[78] = CR_Hanunoo;
  CodeRanges[79] = CR_Hebrew;
  CodeRanges[80] = CR_Hiragana;
  CodeRanges[81] = CR_Inherited;
  CodeRanges[82] = CR_Kannada;
  CodeRanges[83] = CR_Katakana;
  CodeRanges[84] = CR_Kharoshthi;
  CodeRanges[85] = CR_Khmer;
  CodeRanges[86] = CR_Lao;
  CodeRanges[87] = CR_Latin;
  CodeRanges[88] = CR_Limbu;
  CodeRanges[89] = CR_Linear_B;
  CodeRanges[90] = CR_Malayalam;
  CodeRanges[91] = CR_Mongolian;
  CodeRanges[92] = CR_Myanmar;
  CodeRanges[93] = CR_New_Tai_Lue;
  CodeRanges[94] = CR_Ogham;
  CodeRanges[95] = CR_Old_Italic;
  CodeRanges[96] = CR_Old_Persian;
  CodeRanges[97] = CR_Oriya;
  CodeRanges[98] = CR_Osmanya;
  CodeRanges[99] = CR_Runic;
  CodeRanges[100] = CR_Shavian;
  CodeRanges[101] = CR_Sinhala;
  CodeRanges[102] = CR_Syloti_Nagri;
  CodeRanges[103] = CR_Syriac;
  CodeRanges[104] = CR_Tagalog;
  CodeRanges[105] = CR_Tagbanwa;
  CodeRanges[106] = CR_Tai_Le;
  CodeRanges[107] = CR_Tamil;
  CodeRanges[108] = CR_Telugu;
  CodeRanges[109] = CR_Thaana;
  CodeRanges[110] = CR_Thai;
  CodeRanges[111] = CR_Tibetan;
  CodeRanges[112] = CR_Tifinagh;
  CodeRanges[113] = CR_Ugaritic;
  CodeRanges[114] = CR_Yi;
#endif /* USE_UNICODE_PROPERTIES */

  CodeRangeTableInited = 1;
  THREAD_ATOMIC_END;
}