File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -48,17 +48,18 @@ extern const uint32_t qjsc_repl_size;
48
48
extern const uint8_t qjsc_standalone [];
49
49
extern const uint32_t qjsc_standalone_size ;
50
50
51
+ // Must match standalone.js
52
+ #define TRAILER_SIZE 12
53
+ static const char trailer_magic [] = "quickjs2" ;
54
+ static const int trailer_magic_size = sizeof (trailer_magic ) - 1 ;
55
+ static const int trailer_size = TRAILER_SIZE ;
56
+
51
57
static int qjs__argc ;
52
58
static char * * qjs__argv ;
53
59
54
60
55
61
static BOOL is_standalone (const char * exe )
56
62
{
57
- // Must match standalone.js
58
- static const char trailer_magic [] = "quickjs2" ;
59
- static const int trailer_magic_size = sizeof (trailer_magic ) - 1 ;
60
- static const int trailer_size = 12 ; /* 8 bytes for the trailer magic + 4 bytes for the offset. */
61
-
62
63
FILE * exe_f = fopen (exe , "rb" );
63
64
if (!exe_f ) {
64
65
perror (exe );
@@ -67,7 +68,7 @@ static BOOL is_standalone(const char *exe)
67
68
if (fseek (exe_f , - trailer_size , SEEK_END ) < 0 ) {
68
69
exit (1 );
69
70
}
70
- uint8_t buf [trailer_size ];
71
+ uint8_t buf [TRAILER_SIZE ];
71
72
if (fread (buf , 1 , trailer_size , exe_f ) != trailer_size ) {
72
73
perror ("fread exe trailer" );
73
74
exit (1 );
You can’t perform that action at this time.
0 commit comments