Rinnegatamante / vitaGL

openGL wrapper for PSVITA.
GNU Lesser General Public License v3.0
466 stars 46 forks source link

Use XXH_NAMESPACE to prevent multiple definitions #111

Closed scribam closed 6 months ago

scribam commented 6 months ago

I found an other way to prevent multiple definitions. This one works (it builds without errors), you can check the Flycast CI on my fork at https://github.com/scribam/flycast/actions/runs/9226300444.

scribam commented 6 months ago

Exported symbols are prefixed with VITAGL_ with these changes:

$ arm-vita-eabi-readelf -s /usr/local/vitasdk/arm-vita-eabi/lib/libvitaGL.a | grep XXH
     5: 00000001   556 FUNC    LOCAL  DEFAULT    1 XXH3_mergeAccs
     7: 0000022d   750 FUNC    LOCAL  DEFAULT    1 XXH64_finalize
     8: 0000051d  2630 FUNC    LOCAL  DEFAULT    1 XXH3_len_129to240_64b
     9: 00000f65  3452 FUNC    LOCAL  DEFAULT    1 XXH3_len_129to240_128b
    10: 00001ce1  1120 FUNC    LOCAL  DEFAULT    1 XXH3_hashLong_128b_withSe
    14: 00002141  1072 FUNC    LOCAL  DEFAULT    1 XXH3_hashLong_128b_defaul
    17: 00002571  1008 FUNC    LOCAL  DEFAULT    1 XXH3_hashLong_64b_default
    20: 00002961  1056 FUNC    LOCAL  DEFAULT    1 XXH3_hashLong_64b_withSec
    23: 00002d81  2564 FUNC    LOCAL  DEFAULT    1 XXH3_hashLong_64b_withSee
    28: 00003785  2664 FUNC    LOCAL  DEFAULT    1 XXH3_hashLong_128b_withSe
   121: 00000040   192 OBJECT  LOCAL  DEFAULT    6 XXH3_kSecret
   148: 000041ed     6 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH_versionNumber
   149: 000041f5   602 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH32
   150: 00004451     6 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH32_createState
   152: 00004459    10 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH32_freeState
   154: 00004465    46 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH32_copyState
   155: 00004495    60 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH32_reset
   157: 000044d1   568 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH32_update
   159: 00004709   260 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH32_digest
   160: 0000480d     6 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH32_canonicalFro
   161: 00004815     6 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH32_hashFromCano
   162: 0000481d  1024 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH64
   163: 00004c1d     6 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH64_createState
   164: 00004c25    10 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH64_freeState
   165: 00004c31     6 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH64_copyState
   166: 00004c39   104 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH64_reset
   167: 00004ca1   858 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH64_update
   168: 00004ffd   516 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH64_digest
   169: 00005201    32 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH64_canonicalFro
   170: 00005221    14 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH64_hashFromCano
   171: 00005231  1912 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_64bits
   172: 000059a9  1874 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_64bits_withSe
   173: 000060fd  2040 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_64bits_withSe
   174: 000068f5  2014 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_64bits_withSe
   175: 000070d5    42 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_createState
   176: 00007101    22 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_freeState
   177: 00007119     8 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_copyState
   178: 00007121   196 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_64bits_reset
   179: 000071e5   196 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_64bits_reset_
   180: 000072a9   436 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_64bits_reset_
   181: 0000745d   220 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_64bits_reset_
   182: 00007539  1746 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_64bits_update
   183: 00007c0d  1140 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_64bits_digest
   184: 00008081  2648 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_128bits
   185: 00008ad9  3076 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_128bits_withS
   186: 000096dd  3290 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_128bits_withS
   187: 0000a3b9  3248 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_128bits_withS
   188: 0000b069    24 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH128
   189: 0000b081   196 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_128bits_reset
   190: 0000b145   196 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_128bits_reset
   191: 0000b209     4 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_128bits_reset
   192: 0000b20d   220 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_128bits_reset
   193: 0000b2e9     4 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_128bits_updat
   194: 0000b2ed  1228 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_128bits_diges
   195: 0000b7b9    60 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH128_isEqual
   196: 0000b7f5    76 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH128_cmp
   197: 0000b841    44 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH128_canonicalFr
   198: 0000b86d    18 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH128_hashFromCan
   199: 0000b881  1614 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_generateSecre
   200: 0000bed1   624 FUNC    GLOBAL DEFAULT    1 VITAGL_XXH3_generateSecre